mirror of
https://git.freebsd.org/ports.git
synced 2025-07-12 06:49:18 -04:00
31 lines
602 B
Bash
31 lines
602 B
Bash
#!/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
|