22 lines
514 B
Bash
22 lines
514 B
Bash
|
function checkUpdate() {
|
||
|
lastUpdateFile=$HOME/.config/last-system-update
|
||
|
|
||
|
if [ ! -f "$lastUpdateFile" ]; then
|
||
|
echo "this system hasn't ever been updated using system-upgrade.sh"
|
||
|
echo "run system-upgrade.sh now"
|
||
|
return
|
||
|
fi
|
||
|
|
||
|
lastUpdate=$(cat $lastUpdateFile)
|
||
|
now=$(date "+%s")
|
||
|
|
||
|
if [ $(( $now - $lastUpdate > 604800 )) ]; then
|
||
|
echo "this system hasn't been updated for over a week"
|
||
|
echo "run system-upgrade.sh asap"
|
||
|
return
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
checkUpdate
|
||
|
|