export SAVE_OVERLAY=0
export DELAY=
export CONF_IMAGE=
+export HELP=0
# parse options
while [ -n "$1" ]; do
-n) export SAVE_CONFIG=0;;
-c) export SAVE_OVERLAY=1;;
-f) export CONF_IMAGE="$2"; shift;;
+ -h|--help) export HELP=1; break;;
-*)
echo "Invalid option: $1"
exit 1
export ARGV="$*"
export ARGC="$#"
-[ -z "$ARGV" ] && {
+[ -z "$ARGV" -o $HELP -gt 0 ] && {
cat <<EOF
Usage: $0 [options] <image file or URL>
-n do not save configuration over reflash
-q less verbose
-v more verbose
+ -h / --help display this help
EOF
exit 1
else
export SAVE_CONFIG=0
fi
+
run_hooks "" $sysupgrade_pre_upgrade
+kill_remaining TERM
+sleep 3
+kill_remaining KILL
+
if [ -n "$(rootfs_type)" ]; then
v "Switching to ramdisk..."
run_ramfs '. /etc/functions.sh; include /lib/upgrade; do_upgrade'