summaryrefslogtreecommitdiffstats
path: root/packaging/Caldera/OpenServer/smb.init
blob: 194b8a2bb29d333850c11d148f7d7c40f89e3898 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
#ident  "@(#)samba.server 1.0   96/06/19 TK"    /* SVr4.0 1.1.13.1*/
#
# Please send info on modifications to knuutila@cs.utu.fi
#
# This file should have uid root, gid sys and chmod 744
#
# Modified 17-Jul-99 by Ron Record (rr@sco.com) for use in SCO Skunkware
#

SAMBADIR=/usr/lib/samba
RCSCRIPT=/etc/rc2.d/S99samba

killproc() {            # kill the named process(es)
    if [ -f /var/locks/samba.d/$1.pid ] 
    then
        kill `cat /var/locks/samba.d/$1.pid`
    else
        pid=`/bin/ps -e |
             /bin/grep $1 |
             /bin/sed -e 's/^  *//' -e 's/ .*//'`
        [ "$pid" != "" ] && kill $pid
    fi
}

start() {
#
# Edit these lines to suit your installation (paths, workgroup, host)
#
   $SAMBADIR/sbin/smbd -D -s /etc/samba.d/smb.conf
   $SAMBADIR/sbin/nmbd -D -s /etc/samba.d/smb.conf
}

stop() {
   killproc nmbd
   killproc smbd
}

# Start/stop processes required for samba server

case "$1" in

'start')
   start
   ;;
'stop')
   stop
   ;;
'restart')
   stop
   start
   ;;
'enable')
   if [ -h $RCSCRIPT ] ; then
      echo "Samba is already enabled."
   else
      echo "Enabling Samba ... \c"
      rm -f $RCSCRIPT
      ln -s /etc/init.d/samba $RCSCRIPT
      echo "Done"
   fi
   ;;
'disable')
   echo "Disabling Samba ... \c"
   rm -f $RCSCRIPT
   echo "Done"
   ;;
*)
   echo "Usage: /etc/init.d/samba { start | stop | restart | enable | disable }"
   ;;
esac