diff --git a/rc b/rc index dfd4b2e..797a4b2 100755 --- a/rc +++ b/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