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