diff options
author | Tim Dickson <dickson.tim@googlemail.com> | 2020-09-03 11:29:43 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-09-05 08:26:42 +0700 |
commit | 74383f0f1911db5505eb12cdb9c5bd23a895030e (patch) | |
tree | 64db068981c4ca3a3a8542f69a9f6e786dba2651 /network/wsdd2/rc.wsdd2 | |
parent | 0e8648ec0c91de7504e2621f9e79f91633676a8e (diff) | |
download | slackbuilds-74383f0f1911db5505eb12cdb9c5bd23a895030e.tar.xz |
network/wsdd2: Added (WSD/LLMNR Descovery/Name Service Daemon)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/wsdd2/rc.wsdd2')
-rw-r--r-- | network/wsdd2/rc.wsdd2 | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/network/wsdd2/rc.wsdd2 b/network/wsdd2/rc.wsdd2 new file mode 100644 index 000000000000..594e1faab537 --- /dev/null +++ b/network/wsdd2/rc.wsdd2 @@ -0,0 +1,58 @@ +#!/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 +# after the samba test (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 + |