#!/bin/sh
#
# Copyright (c) Timo Knuutila <knuutila@cs.utu.fi>     1996.
#
# This file should have uid root, gid sys and chmod 744
#
if [ ! -d /bin ]
then                    # /usr not mounted
        exit
fi

killproc() {            # kill the named process(es)
        pid=`/bin/ps -e |
             /bin/grep -w $1 |
             /bin/sed -e 's/^  *//' -e 's/ .*//'`
        [ "$pid" != "" ] && kill $pid
}

# Start/stop processes required for samba server

case "$1" in

'start')
#
# Edit these lines to suit your installation (paths, workgroup, host)
#
   /usr/sbin/smbd -D -s/etc/samba/smb.conf
   /usr/sbin/nmbd -D -l/var/log/samba -s/etc/samba/smb.conf
   ;;
'stop')
   killproc nmbd
   killproc smbd
   ;;
*)
   echo "Usage: /etc/init.d/samba { start | stop }"
   ;;
esac
