stop if not writable
This commit is contained in:
2
rc
2
rc
@@ -24,7 +24,7 @@ function _self_update() {
|
||||
[[ -t 1 ]] || return
|
||||
[[ -t 2 ]] || return
|
||||
[[ -f "$TOOLSPATH"/.lastupdate ]] || touch -t 0101010101 "$TOOLSPATH"/.lastupdate 2> /dev/null
|
||||
[[ -f "$TOOLSPATH"/.lastupdate ]] || return
|
||||
[[ -w "$TOOLSPATH"/.lastupdate ]] || return
|
||||
|
||||
TOOLS_LASTUPDATE=$(( $( date +%s ) - $( stat -c %Y "$TOOLSPATH"/.lastupdate ) ))
|
||||
[[ "$TOOLS_LASTUPDATE" -gt 604800 ]] && _self_update
|
||||
|
||||
Reference in New Issue
Block a user