mirror of
				https://github.com/nmasur/dotfiles
				synced 2025-11-04 01:13:15 +00:00 
			
		
		
		
	option to clear weather cache
This commit is contained in:
		@@ -1,7 +1,12 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CACHE_FILE="$HOME/.cache/.weather_cache"
 | 
					CACHE_FILE="$HOME/.cache/weather_cache"
 | 
				
			||||||
CACHE_TIME="$(stat -f %m "$CACHE_FILE")"
 | 
					
 | 
				
			||||||
 | 
					if [ "$1" = "clear" ]; then
 | 
				
			||||||
 | 
					    rm -f "$CACHE_FILE"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CACHE_TIME="$(stat -f %m "$CACHE_FILE" 2>/dev/null)"
 | 
				
			||||||
NOW_TIME=$(date +%s)
 | 
					NOW_TIME=$(date +%s)
 | 
				
			||||||
TIME_PASSED=$((NOW_TIME-CACHE_TIME))
 | 
					TIME_PASSED=$((NOW_TIME-CACHE_TIME))
 | 
				
			||||||
if [ "$TIME_PASSED" -gt "1200" ]
 | 
					if [ "$TIME_PASSED" -gt "1200" ]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user