summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbrodkorb@conet.de>2015-06-19 14:54:33 +0200
committerWaldemar Brodkorb <wbrodkorb@conet.de>2015-06-19 14:54:33 +0200
commitf5785293d05fde484936f2dd95e860687d2e9cf0 (patch)
tree652e01c5f9c92fcd13dfad9ccc794b4d215624ca
parent1c2ce0120afa726d1f54957542c095f21c8fded8 (diff)
add startup script
-rw-r--r--package/ympd/files/ympd.init29
-rw-r--r--package/ympd/files/ympd.postinst3
2 files changed, 32 insertions, 0 deletions
diff --git a/package/ympd/files/ympd.init b/package/ympd/files/ympd.init
new file mode 100644
index 000000000..f1510263c
--- /dev/null
+++ b/package/ympd/files/ympd.init
@@ -0,0 +1,29 @@
+#!/bin/sh
+#PKG ympd
+#INIT 90
+
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${ympd:-NO}" = x"NO" && exit 0
+ test x"$ympd" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
+ exec sh $0 start
+ ;;
+start)
+ ympd -w 80 &
+ ;;
+stop)
+ kill $(pgrep -f /usr/bin/ympd)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/ympd/files/ympd.postinst b/package/ympd/files/ympd.postinst
new file mode 100644
index 000000000..abc75c6f7
--- /dev/null
+++ b/package/ympd/files/ympd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf ympd NO