#!/bin/sh rc_file=${0##*/} if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${rc_file}\$"); then echo "${rc_file}: Cannot determine PREFIX." >&2 echo "Please use the complete pathname." >&2 exit 64 fi smbspool=/var/spool/samba pidfiledir=/var/run smbd=${PREFIX}/sbin/smbd nmbd=${PREFIX}/sbin/nmbd # start if [ "x$1" = "x" -o "x$1" = "xstart" ]; then if [ -f $smbd ]; then if [ -d $smbspool ]; then rm -f $smbspool/* fi echo -n ' Samba' $smbd -D $nmbd -D fi # stop elif [ "x$1" = "xstop" ]; then kill `cat $pidfiledir/smbd.pid` kill `cat $pidfiledir/nmbd.pid` fi