debian: add an option to diable wcs at boot

update-rc.d disable doesn't work properly and display an unreadable
output
This commit is contained in:
Jérôme Schneider 2013-10-29 15:19:28 +01:00
parent 7229c2c10d
commit fb5df20311
1 changed files with 22 additions and 9 deletions

31
debian/wcs.init vendored
View File

@ -28,19 +28,32 @@ then
. /etc/default/$NAME
fi
is_true() {
if [ "x$1" = "xtrue" -o "x$1" = "xyes" -o "x$1" = "x0" ] ; then
return 0
else
return 1
fi
}
#
# Function that starts the daemon/service.
#
d_start() {
if [ $CONFIG_FILE ]; then
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--chuid $WCS_USER:$WCS_GROUP --make-pidfile --background \
--exec $DAEMON -- -f $CONFIG_FILE start $OPTIONS
else
start-stop-daemon --start --quiet --pidfile $pidfile \
--chuid $WCS_USER:$WCS_GROUP --make-pidfile --background \
--exec $DAEMON -- start $OPTIONS
fi
if is_true "$START" ; then
if [ $CONFIG_FILE ]; then
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--chuid $WCS_USER:$WCS_GROUP --make-pidfile --background \
--exec $DAEMON -- -f $CONFIG_FILE start $OPTIONS
else
start-stop-daemon --start --quiet --pidfile $pidfile \
--chuid $WCS_USER:$WCS_GROUP --make-pidfile --background \
--exec $DAEMON -- start $OPTIONS
fi
else
echo ""
echo "w.c.s. not configured to start, please edit /etc/default/wcs to enable"
fi
}
#