From f5785293d05fde484936f2dd95e860687d2e9cf0 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 19 Jun 2015 14:54:33 +0200 Subject: add startup script --- package/ympd/files/ympd.init | 29 +++++++++++++++++++++++++++++ package/ympd/files/ympd.postinst | 3 +++ 2 files changed, 32 insertions(+) create mode 100644 package/ympd/files/ympd.init create mode 100644 package/ympd/files/ympd.postinst 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 -- cgit v1.2.3