mirror of
				https://github.com/DaoCloud/public-image-mirror.git
				synced 2025-11-01 06:19:36 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			725 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			725 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| 
 | |
| set -o errexit
 | |
| set -o nounset
 | |
| set -o pipefail
 | |
| 
 | |
| QUICKLY="${QUICKLY:-}"
 | |
| cat *"_sync.log" > "sync.log"
 | |
| sync="$(cat "sync.log" | grep " SYNCHRONIZED: " | wc -l | tr -d ' ' || :)"
 | |
| unsync="$(cat "sync.log" | grep " NOT-SYNCHRONIZED: " | wc -l | tr -d ' ' || :)"
 | |
| sum=$(($sync + $unsync))
 | |
| 
 | |
| if [[ "${sum}" -eq 0 ]]; then
 | |
|     echo "No sync"
 | |
|     exit 1    
 | |
| fi
 | |
| 
 | |
| if [[ "${QUICKLY}" == "true" ]]; then
 | |
|     echo "https://img.shields.io/badge/Sync-${sync}%2F${sum}-blue"
 | |
|     wget "https://img.shields.io/badge/Sync-${sync}%2F${sum}-blue" -O badge.svg
 | |
| else
 | |
|     echo "https://img.shields.io/badge/Deep%20Sync-${sync}%2F${sum}-blue"
 | |
|     wget "https://img.shields.io/badge/Deep%20Sync-${sync}%2F${sum}-blue" -O badge.svg
 | |
| fi
 |