#! /bin/sh
IS_ON=/etc/chkconfig
KILLALL=/sbin/killall
SAMBAD=/usr/samba/bin/smbd
NMBD=/usr/samba/bin/nmbd
if test ! -x $IS_ON ; then
IS_ON=true
fi
if $IS_ON verbose ; then
ECHO=echo
else ECHO=:
fi
case $1 in
'profile')
if $IS_ON samba && test -x $SAMBAD; then
$KILLALL -15 smbd nmbd smbd.profile nmbd.profile
$ECHO "Samba:\c"
$SAMBAD.profile $SAMBA_OPTS -D; $ECHO " smbd.profile\c"
$NMBD.profile $NMBD_OPTS -D; $ECHO " nmbd.profile\c"
$ECHO "."
fi
;;
'start')
if $IS_ON samba && test -x $SAMBAD; then
$KILLALL -15 smbd nmbd smbd.profile nmbd.profile
$ECHO "Samba:\c"
$SAMBAD $SAMBA_OPTS -D; $ECHO " smbd\c"
$NMBD $NMBD_OPTS -D; $ECHO " nmbd\c"
$ECHO "."
fi
;;
'stop')
$ECHO "Stopping Samba Servers."
$KILLALL -15 smbd nmbd smbd.profile nmbd.profile
exit 0
;;
*)
echo "usage: /etc/init.d/samba {start|stop}"
;;
esac