1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-15 11:53:59 +02:00
openwrt-packages/utils/rpcd-mod-attendedsysupgrade/files/attendedsysupgrade.rpcd
Paul Spooren f9a6c81c11 rpcd-mod-attendedsysupgrade: add package
add ubus call to perform a sysupgrade and acl file for the attended
sysupgrade use case as well uci defaults.
Package is a part of the GSoC 17 project implementing easy
sysupgrade functionality.

Signed-off-by: Paul Spooren <paul@spooren.de>
2017-07-25 19:29:21 +02:00

30 lines
502 B
Bash
Executable File

#!/bin/sh
. /usr/share/libubox/jshn.sh
case "$1" in
list)
json_init
json_add_object "sysupgrade"
json_close_object
json_dump
;;
call)
case "$2" in
sysupgrade)
if [ -f "/tmp/sysupgrade.bin" ]; then
/etc/init.d/uhttpd stop
/etc/init.d/dropbear stop
sleep 1;
/sbin/sysupgrade -c /tmp/sysupgrade.bin
fi
json_init
json_add_string "message" "could not find /tmp/sysupgrade.bin"
json_dump
esac
;;
esac