CONF_BACKUP_LIST=0
CONF_BACKUP=
CONF_RESTORE=
+USE_CURR_PART=0
NEED_IMAGE=
HELP=0
TEST=0
-r|--restore-backup) CONF_RESTORE="$2" NEED_IMAGE=1; shift;;
-l|--list-backup) CONF_BACKUP_LIST=1;;
-f) CONF_IMAGE="$2"; shift;;
+ -s) USE_CURR_PART=1;;
-F|--force) export FORCE=1;;
-T|--test) TEST=1;;
-h|--help) HELP=1; break;;
-p do not attempt to restore the partition table after flash.
-k include in backup a list of current installed packages at
$INSTALLED_PACKAGES
+ -s stay on current partition (for dual firmware devices)
-T | --test
Verify image and config .tar.gz but do not actually flash.
-F | --force
json_add_string command "$COMMAND"
json_add_object options
json_add_int save_partitions "$SAVE_PARTITIONS"
+ [ $USE_CURR_PART -eq 1 ] && json_add_boolean use_curr_part 1
json_close_object
ubus call system sysupgrade "$(json_dump)"