diff options
Diffstat (limited to 'package/alix-switch/files')
-rw-r--r-- | package/alix-switch/files/alix-switch | 15 | ||||
-rw-r--r-- | package/alix-switch/files/alix-switch.init | 27 | ||||
-rw-r--r-- | package/alix-switch/files/alix-switch.postinst | 3 |
3 files changed, 45 insertions, 0 deletions
diff --git a/package/alix-switch/files/alix-switch b/package/alix-switch/files/alix-switch new file mode 100644 index 000000000..ad439a221 --- /dev/null +++ b/package/alix-switch/files/alix-switch @@ -0,0 +1,15 @@ +#!/bin/sh +# launched by alix-switchd in case of button event + +case "$1" in + on) + echo "alix-switch: on" + ;; + off) + echo "alix-switch: off" + ;; + *) + echo "Usage: $0 {on|off}" + ;; +esac +exit 0 diff --git a/package/alix-switch/files/alix-switch.init b/package/alix-switch/files/alix-switch.init new file mode 100644 index 000000000..c783a1be5 --- /dev/null +++ b/package/alix-switch/files/alix-switch.init @@ -0,0 +1,27 @@ +#!/bin/sh +#PKG alix-switch +#INIT 10 + +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + test x"${alix_switch:-NO}" = x"NO" && exit 0 + exec sh $0 start + ;; +start) + alix-switchd -d + ;; +stop) + pkill alix-switchd + ;; +restart) + sh $0 stop + sh $0 start + ;; +*) + echo "usage: $0 (start|stop|restart)" + exit 1 +esac +exit $? diff --git a/package/alix-switch/files/alix-switch.postinst b/package/alix-switch/files/alix-switch.postinst new file mode 100644 index 000000000..6e0e60f12 --- /dev/null +++ b/package/alix-switch/files/alix-switch.postinst @@ -0,0 +1,3 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf alix_switchd alix_switchd NO |