1998-08-24 02:11:20 +00:00
|
|
|
#!/bin/sh
|
1999-09-04 17:18:35 +00:00
|
|
|
#
|
|
|
|
# Startup for wcol daemon
|
|
|
|
#
|
1998-08-24 02:11:20 +00:00
|
|
|
|
1999-09-04 17:18:35 +00:00
|
|
|
# default settings.
|
|
|
|
wcol_program=@@PREFIX@@/wcol/wcol
|
|
|
|
wcol_kill_program=@@PREFIX@@/wcol/killwcol
|
|
|
|
wcol_conf=@@PREFIX@@/etc/wcol.conf
|
|
|
|
wcol_spooldir=@@DEFAULT_POOLDIR@@
|
|
|
|
wcol_pid=/var/run/wcol.pid
|
|
|
|
|
|
|
|
#
|
|
|
|
# If there is a global system configuration file, suck it in.
|
|
|
|
#
|
|
|
|
if [ -f /etc/defaults/rc.conf ]; then
|
|
|
|
. /etc/defaults/rc.conf
|
|
|
|
elif [ -f /etc/rc.conf ]; then
|
|
|
|
. /etc/rc.conf
|
1998-08-24 02:11:20 +00:00
|
|
|
fi
|
1999-09-04 17:18:35 +00:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
'start')
|
|
|
|
if [ "x${wcol_enable}" = "xYES" ] ; then
|
|
|
|
if [ -f ${wcol_conf} -a -f ${wcol_program} ]; then
|
|
|
|
if [ ! -d ${wcol_spooldir} ]; then
|
|
|
|
/bin/mkdir ${wcol_spooldir}
|
|
|
|
fi
|
|
|
|
${wcol_program} >/dev/null 2>&1 &
|
|
|
|
echo -n ' wcol'
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
'stop')
|
|
|
|
if [ -f ${wcol_kill_program} ]; then
|
|
|
|
${wcol_kill_program} >/dev/null 2>&1
|
|
|
|
else
|
|
|
|
PID=`cat ${wcol_pid}`
|
|
|
|
if [ ! -z "$PID" ] ; then
|
|
|
|
/bin/kill ${PID} >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
/bin/rm -f ${wcol_pid}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: wcol.sh { start | stop }"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|