nsm/functions/check
2025-04-25 21:03:38 +02:00

39 lines
870 B
Bash

#!/usr/bin/env bash
function check_help() {
usage_general
cat<<EOF
commands:
$(basename ${0}) check remote
$(basename ${0}) check local
$(basename ${0}) check quiet
EOF
}
function check_remote() {
get_latest_novos_version > "$RUN_DIR/upstream_release"
}
function check_local() {
if [[ $(get_current_novos_version) < $(get_cached_novos_version) ]]; then
if ! test -f "$RUN_DIR/quiet"; then
cat<<EOF
There is a newer NOVOS version available: $(get_cached_novos_version)
To upgrade to this version, execute: 'nsm sysupgrade'
This message will vanish if you upgrade or type 'nsm check quiet' for some reason.
EOF
fi
return 1
else
if ! (( shell )); then
log i "Your're running the latest NOVOS version! :)"
fi
fi
return 0
}
function check_quiet() {
if ! test -f "$RUN_DIR/quiet"; then
touch "$RUN_DIR/quiet"
fi
}