wok-next view samba/stuff/etc/init.d/samba @ rev 1721

syslinux: generate locale configuration
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Nov 18 16:14:09 2008 +0000 (2008-11-18)
parents
children 62384d6ba510
line source
1 #!/bin/sh
2 # /etc/init.d/samba : Start, stop and restart Samba server on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start Samba server at boot time, just put samba in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=Samba
12 DESC="Samba server"
13 SMBD=/usr/sbin/smbd
14 NMBD=/usr/sbin/nmbd
15 NMBPIDFILE=/var/run/samba/nmbd.pid
16 SMBPIDFILE=/var/run/samba/smbd.pid
18 case "$1" in
19 start)
20 if [ -f $SMBPIDFILE ] ; then
21 echo "$NAME already running."
22 exit 1
23 fi
24 echo -n "Starting $DESC: $SMBD... "
25 $SMBD -D
26 status
27 echo -n "Starting $DESC: $NMBD... "
28 $NMBD -D
29 status
30 ;;
31 stop)
32 if [ ! -f $SMBPIDFILE ] ; then
33 echo "$NAME is not running."
34 exit 1
35 fi
36 echo -n "Stopping $DESC: $SMBD... "
37 kill `cat $SMBPIDFILE`
38 status
39 echo -n "Stopping $DESC: $NMBD... "
40 kill `cat $NMBPIDFILE`
41 status
42 ;;
43 restart)
44 if [ ! -f $SMBPIDFILE ] ; then
45 echo "$NAME is not running."
46 exit 1
47 fi
48 echo -n "Restarting $DESC: $SMBD... "
49 kill `cat $SMBPIDFILE`
50 sleep 2
51 $SMBD -D
52 status
53 echo -n "Restarting $DESC: $NMBD... "
54 kill `cat $NMBPIDFILE`
55 sleep 2
56 $NMBD -D
57 status
58 ;;
59 reload)
60 if [ ! -f $SMBPIDFILE ] ; then
61 echo "$NAME is not running."
62 exit 1
63 fi
64 echo -n "Reloading $DESC: $SMBD... "
65 kill -HUP `cat $SMBPIDFILE`
66 status
67 ;;
68 *)
69 echo ""
70 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart!reload]"
71 echo ""
72 exit 1
73 ;;
74 esac
76 exit 0