summaryrefslogtreecommitdiffstats
path: root/packaging/Solaris/x86/samba.init
blob: 6a7424408909feb7c77dbcd02626daec30fcc46b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
if [ ! -d /usr/bin ]; then
	echo "The /usr file system is not mounted."
        exit 1
fi

killproc() {         
        pid=`/bin/ps ax | grep -w $1 | sed -e 's/^  *//' -e 's/ .*//'`
	echo "Stopping $1 now."
        [ "$pid" != "" ] && kill -15 $pid
	echo $pid
}


# Start/stop processes required for samba server

case "$1" in

	'start')
	   echo "Starting Samba"
	   /usr/local/samba/bin/smbd
	   /usr/local/samba/bin/nmbd
	   echo "Done."
	   ;;
	'stop')
	   killproc smbd
	   killproc nmbd
	   ;;
	*)
	   echo "Usage: /sbin/init.d/samba.init [ start | stop ]"
	   ;;
esac
exit 0