1#!/bin/sh
2#ident  "@(#)samba.server 1.0   96/06/19 TK"    /* SVr4.0 1.1.13.1*/
3#
4# Please send info on modifications to knuutila@cs.utu.fi
5#
6# This file should have uid root, gid sys and chmod 744
7#
8if [ ! -d /usr/bin ]
9then                    # /usr not mounted
10        exit
11fi
12
13killproc() {            # kill the named process(es)
14        pid=`/usr/bin/ps -e |
15             /usr/bin/grep -w $1 |
16             /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
17        [ "$pid" != "" ] && kill $pid
18}
19
20# Start/stop processes required for samba server
21
22case "$1" in
23
24'start')
25#
26# Edit these lines to suit your installation (paths, workgroup, host)
27#
28   BASE=__BASEDIR__/samba
29   $BASE/bin/smbd -D -s$BASE/lib/smb.conf
30   $BASE/bin/nmbd -D -s$BASE/lib/smb.conf
31   ;;
32'stop')
33   killproc nmbd
34   killproc smbd
35   ;;
36
37'restart')
38   killproc nmbd
39   killproc smbd
40   BASE=__BASEDIR__/samba
41   $BASE/bin/smbd -D -s$BASE/lib/smb.conf
42   $BASE/bin/nmbd -D -l$BASE/var/log -s$BASE/lib/smb.conf
43   ;;
44
45*)
46   echo "Usage: /etc/init.d/samba.server { start | stop | restart }"
47   ;;
48esac
49