summaryrefslogtreecommitdiff
path: root/package/alix-switch/files
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-07-19 10:49:49 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2010-07-19 10:49:49 +0200
commit7907e3ee7302ac3fd428989a07b0df74f0c52853 (patch)
treee6de18488a687707667927065724372b40510d65 /package/alix-switch/files
parentb70fdbfbf1139605c22083b647337f2b16f62fc3 (diff)
parent61355d1f054c15673adeb62d32dfd4563f89c165 (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package/alix-switch/files')
-rw-r--r--package/alix-switch/files/alix-switch19
-rw-r--r--package/alix-switch/files/alix-switch.init27
-rw-r--r--package/alix-switch/files/alix-switch.postinst3
3 files changed, 49 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..b61a6a48f
--- /dev/null
+++ b/package/alix-switch/files/alix-switch
@@ -0,0 +1,19 @@
+#!/bin/sh
+# launched by alix-switchd in case of button event
+# f.e. boot rescue system once
+case "$1" in
+ on)
+ echo "alix-switch: on"
+ mount /dev/sda1 /boot/grub
+ grub-reboot 1
+ umount /boot/grub
+ reboot
+ ;;
+ off)
+ echo "alix-switch: off"
+ ;;
+ *)
+ echo "Usage: $0 {on|off}"
+ ;;
+esac
+exit $?
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..28146bf44
--- /dev/null
+++ b/package/alix-switch/files/alix-switch.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf alix_switch alix_switch YES