Browse Source

Merge pull request #4689 from aparcar/keep_settings

rpcd-mod-attendedsysupgrade: add keep_settings opt
lilik-openwrt-22.03
Daniel Golle 7 years ago
committed by GitHub
parent
commit
8730461cc1
1 changed files with 17 additions and 11 deletions
  1. +17
    -11
      utils/rpcd-mod-attendedsysupgrade/files/attendedsysupgrade.rpcd

+ 17
- 11
utils/rpcd-mod-attendedsysupgrade/files/attendedsysupgrade.rpcd View File

@ -5,25 +5,31 @@
case "$1" in
list)
json_init
json_add_object "sysupgrade"
json_close_object
json_dump
;;
call)
case "$2" in
json_add_object "sysupgrade"
json_add_boolean "keep_settings" 1
json_close_object
json_dump
;;
call)
case "$2" in
sysupgrade)
read input;
json_load "$input"
json_get_var keep_settings keep_settings
if [ -f "/tmp/sysupgrade.bin" ]; then
/etc/init.d/uhttpd stop
/etc/init.d/dropbear stop
sleep 1;
/sbin/sysupgrade -c /tmp/sysupgrade.bin
if [ "$keep_settings" -eq "0" ]; then
keep_settings_param="-n"
fi
/sbin/sysupgrade $keep_settings_param /tmp/sysupgrade.bin
fi
json_init
json_add_string "message" "could not find /tmp/sysupgrade.bin"
json_dump
esac
;;
esac
;;
esac

Loading…
Cancel
Save