mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
fix sb-price: touch missing files
fixed a case where on first run, the file will not exist and the `cat` inside `printf` in line 40 will show give an error instead of doing something useful
This commit is contained in:
parent
4231d6bd33
commit
968ebffdde
@ -16,6 +16,8 @@ updateprice() { ping -q -c 1 example.org >/dev/null 2>&1 &&
|
|||||||
curl -s "rate.sx/$1$interval" > "$chartfile" ;}
|
curl -s "rate.sx/$1$interval" > "$chartfile" ;}
|
||||||
|
|
||||||
[ -d "$dir" ] || mkdir -p "$dir"
|
[ -d "$dir" ] || mkdir -p "$dir"
|
||||||
|
[ -f "$pricefile" ] || touch "$pricefile"
|
||||||
|
[ -f "$chartfile" ] || touch "$chartfile"
|
||||||
|
|
||||||
[ "$(stat -c %x "$pricefile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
|
[ "$(stat -c %x "$pricefile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
|
||||||
updateprice "$1"
|
updateprice "$1"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user