Add init framework and automatic start-stop

This commit is contained in:
hirsch 2016-07-09 14:28:13 -04:00
parent f84fceb767
commit ae5b425bf2
7 changed files with 208 additions and 14 deletions

40
mustang_bridge Executable file
View file

@ -0,0 +1,40 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: mustang_bridge
# Required-Start: mountkernfs
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Setup /var/run/mustang directory
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
do_start() {
[ -d /var/run/mustang ] || mkdir /var/run/mustang
if [ -z "$(ls -A -- "/var/run/mustang")" ]; then
touch /var/run/mustang/mustang_0000
fi
}
case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop|status)
# No-op
exit 0
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac