diff --git a/package/gluon-autoupdater/files/etc/init.d/gluon-autoupdater b/package/gluon-autoupdater/files/etc/init.d/gluon-autoupdater new file mode 100755 index 0000000000000000000000000000000000000000..45a1ef62e05f3c084b2e36fb5e43542ae80df1d1 --- /dev/null +++ b/package/gluon-autoupdater/files/etc/init.d/gluon-autoupdater @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common + +START=99 + +SERVICE_NAME=gluon-autoupdater +SERVICE_WRITE_PID=1 +SERVICE_DAEMONIZE=1 + + +start() { + [ "$(uci get autoupdater.settings.enabled)" = 1 ] || return + + service_start /bin/sh /lib/gluon/autoupdater/delayed_update +} + +stop() { + service_stop /bin/sh +} diff --git a/package/gluon-autoupdater/files/lib/gluon/autoupdater/delayed_update b/package/gluon-autoupdater/files/lib/gluon/autoupdater/delayed_update new file mode 100755 index 0000000000000000000000000000000000000000..95841f86783b218917c89ecf5de1b73b166d79e9 --- /dev/null +++ b/package/gluon-autoupdater/files/lib/gluon/autoupdater/delayed_update @@ -0,0 +1,5 @@ +#!/bin/sh + +# wait for 5 minutes after boot +sleep 300 +exec /lib/gluon/autoupdater/autoupdate -o