SlackBuildsOrg/network/wsdd2/rc.wsdd2
Tim Dickson 105af502a9
network/wsdd2: Updated for version 1.8.6.
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2022-04-30 13:51:52 +07:00

58 lines
1.2 KiB
Bash

#!/bin/sh
#
# /etc/rc.d/rc.wsdd2
#
# start/stop/restart the wsdd2 daemon.
#
# To make wsdd2 start automatically at boot make sure this
# file is executable, and add the following entry to rc.local
# (uncommented)
# if [ -x /etc/rc.d/rc.wsdd2 ]; then
# /etc/rc.d/rc.wsdd2 start
# fi
# you may also add the following entry to rc.local_shutdown
# (uncommented)
# if [ -x /etc/rc.d/rc.wsdd2 ]; then
# /etc/rc.d/rc.wsdd2 stop
# fi
wsdd2_start() {
if [ -r /etc/samba/smb.conf -a -x /etc/rc.d/rc.samba -a -x /usr/sbin/wsdd2 ]; then
echo "Starting wsdd2: /usr/bin/wsdd2 -d"
/usr/sbin/wsdd2 -d
elif [ ! -r /etc/samba/smb.conf ]; then
echo "ERROR: samba not configured, so wsdd2 has no service to advertise"
fi
}
wsdd2_stop() {
#check something is running before trying to kill it.
if [ "x`ps -A|grep ' wsdd2'|wc -l`" != "x0" ]; then
killall wsdd2
fi
}
wsdd2_restart() {
wsdd2_stop
sleep 1
wsdd2_start
}
case "$1" in
'start')
#we don't want to run this more than once,
#so kill off any instance already running
wsdd2_stop
wsdd2_start
;;
'stop')
wsdd2_stop
;;
'restart')
wsdd2_restart
;;
*)
# default is start
wsdd2_start
esac