X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=packages%2Fxwrt%2Fwebif-hotspot%2Ffiles%2Fusr%2Flib%2Fwebif%2Fapply-hotspot.sh;fp=packages%2Fxwrt%2Fwebif-hotspot%2Ffiles%2Fusr%2Flib%2Fwebif%2Fapply-hotspot.sh;h=c59e155eccdba0d52535ad94a762fc28b1cd4889;hb=292a96bb207a38475873c28a39fc2e72c277ae94;hp=0000000000000000000000000000000000000000;hpb=61edc99f724a295c2fc93eb85fb2d0e57b0b283d;p=librewrt%2F.git diff --git a/packages/xwrt/webif-hotspot/files/usr/lib/webif/apply-hotspot.sh b/packages/xwrt/webif-hotspot/files/usr/lib/webif/apply-hotspot.sh new file mode 100755 index 0000000..c59e155 --- /dev/null +++ b/packages/xwrt/webif-hotspot/files/usr/lib/webif/apply-hotspot.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Hotspot apply handler. + +reload_hotspot() { + echo '@TR<> @TR<> ...' + [ -e /bin/save_hotspot ] && { + /bin/save_hotspot >&- 2>&- + } + ( + config_cb() { + [ "$1" = "chillispot" ] && service_cfg="$2" + } + config_load "hotspot" + config_get_bool test "$service_cfg" enable 0 + chilli_init="/etc/init.d/chilli" + [ -e $chilli_init ] && { + if [ "1" = "$test" ]; then + echo '@TR<> @TR<> ...' + $chilli_init enable >&- 2>&- + $chilli_init stop >&- 2>&- + $chilli_init start >&- 2>&- + else + echo '@TR<> @TR<> ...' + $chilli_init stop >&- 2>&- + $chilli_init disable >&- 2>&- + fi + } + ) +} + +[ -f /tmp/.uci/hotspot ] && { + # save settings + echo "@TR<> $package ..." + uci_commit "hotspot" + reload_hotspot + # and do not save it twice + rm -f /tmp/.uci/hotspot 2>/dev/null +}