2 ## library file for test functions
6 SMBCONTROL="smbcontrol -t 3"
9 ## start/stop smbd daemon
13 ## the smbcontrol ping will return a 0 on success
14 $SMBCONTROL $CONFIGURATION smbd ping 2>&1 > /dev/null
19 echo "Starting smbd...."
21 smbd $CONFIGURATION || return $?
25 $SMBCONTROL $CONFIGURATION `cat $PIDDIR/smbd.pid` ping 2>&1 > /dev/null || return $?
30 smbd_pid=`cat $PIDDIR/smbd.pid`
31 echo "Shutting down smbd (pid $smbd_pid)..."
33 ## belt and braces; first kill and then send a shutdown message
36 $SMBCONTROL $CONFIGURATION smbd shutdown
38 ## check to see if smbd is already running
41 echo "Unable to stop smbd!"
50 if test $ret != 0; then
57 ## start/stop nmbd daemon
61 ## the smbcontrol ping will return a 0 on success
62 $SMBCONTROL $CONFIGURATION nmbd ping 2>&1 > /dev/null
67 echo "Starting nmbd...."
69 nmbd $CONFIGURATION || return $?
73 # smbcontrol $CONFIGURATION `cat $PIDDIR/nmbd.pid` ping 2>&1 > /dev/null || return $?
74 kill -0 `cat $PIDDIR/nmbd.pid`
79 nmbd_pid=`cat $PIDDIR/nmbd.pid`
80 echo "Shutting down nmbd (pid $nmbd_pid)..."
82 ## belt and braces; first kill and then send a shutdown message
84 kill -TERM $nmbd_pid 2> /dev/null
87 ## check to see if smbd is already running
88 kill -0 $nmbd_pid 2> /dev/null
90 echo "Unable to stop nmbd!"