41 lines
987 B
Bash
41 lines
987 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
|
|
|
|
printc "y" "There is a newer NOVOS version available: $(get_cached_novos_version)"
|
|
printc "y" "You are currently running NOVOS $(get_current_novos_version)!"
|
|
echo ""
|
|
printc "y" "To upgrade to this version, execute: 'nsm sysupgrade'"
|
|
printc "y" "This message will vanish if you upgrade or type 'nsm check quiet' for some reason."
|
|
|
|
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
|
|
}
|