mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
sysmngr: fwbank option to restart with upgrade
(cherry picked from commit 1139c21f34)
Co-authored-by: Vivek Kumar Dutta <vivek.dutta@iopsys.eu>
This commit is contained in:
parent
57530b8838
commit
5c9a63c2a1
1 changed files with 29 additions and 2 deletions
|
|
@ -22,7 +22,30 @@ fwbank_get_bootbank() {
|
|||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "dump" : {}, "set_bootbank" : {"bank":32}, "copy_config": {"keep_settings":true, "keep_opconf":true, "config_scope":"String"}, "upgrade": {"path":"String","auto_activate":true,"bank":32,"keep_settings":true,"keep_opconf":true,"config_scope":"String"}}'
|
||||
json_init
|
||||
json_add_object "dump"
|
||||
json_close_object
|
||||
|
||||
json_add_object "set_bootbank"
|
||||
json_add_int "bank" 32
|
||||
json_close_object
|
||||
|
||||
json_add_object "copy_config"
|
||||
json_add_boolean "keep_settings" 1
|
||||
json_add_boolean "keep_opconf" 1
|
||||
json_add_string "config_scope" "String"
|
||||
json_close_object
|
||||
|
||||
json_add_object "upgrade"
|
||||
json_add_string "path" "String"
|
||||
json_add_boolean "auto_activate" 1
|
||||
json_add_int "bank" 32
|
||||
json_add_boolean "keep_settings" 1
|
||||
json_add_boolean "keep_opconf" 1
|
||||
json_add_string "config_scope" "String"
|
||||
json_add_boolean "restart" 1
|
||||
json_close_object
|
||||
json_dump
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
|
|
@ -184,6 +207,7 @@ case "$1" in
|
|||
json_get_var keep_settings keep_settings
|
||||
json_get_var keep_opconf keep_opconf
|
||||
json_get_var config_scope config_scope
|
||||
json_get_var restart restart
|
||||
|
||||
ret=0
|
||||
|
||||
|
|
@ -207,6 +231,7 @@ case "$1" in
|
|||
|
||||
# Set the default value for keep_settings
|
||||
keep_settings=${keep_settings:-1}
|
||||
restart=${restart:-0}
|
||||
|
||||
# This ubus call does not reboot the system at any one time.
|
||||
# Although, the newly upgraded bank is activated by default.
|
||||
|
|
@ -214,7 +239,9 @@ case "$1" in
|
|||
# "--no-activate" otherwise.
|
||||
sysupgrade_flag=""
|
||||
if [ "${auto_activate}" -eq 1 ]; then
|
||||
sysupgrade_flag="--no-reboot"
|
||||
if [ "${restart}" -eq 0 ]; then
|
||||
sysupgrade_flag="--no-reboot"
|
||||
fi
|
||||
else
|
||||
sysupgrade_flag="--no-activate"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue