1#!/bin/sh 2# 3# chkconfig: 345 91 35 4# description: Starts and stops the Samba smbd and nmbd daemons \ 5# used to provide SMB network services. 6 7# Source function library. 8. /etc/rc.d/init.d/functions 9 10# Source networking configuration. 11. /etc/sysconfig/network 12 13# Check that networking is up. 14[ ${NETWORKING} = "no" ] && exit 0 15 16# Check that smb.conf exists. 17[ -f /etc/smb.conf ] || exit 0 18 19# See how we were called. 20case "$1" in 21 start) 22 echo -n "Starting SMB services: " 23 daemon smbd -D 24 daemon nmbd -D 25 echo 26 touch /var/lock/subsys/smb 27 ;; 28 stop) 29 echo -n "Shutting down SMB services: " 30 killproc smbd 31 killproc nmbd 32 rm -f /var/lock/subsys/smb 33 echo "" 34 ;; 35 status) 36 status smbd 37 status nmbd 38 ;; 39 restart) 40 echo -n "Restarting SMB services: " 41 $0 stop 42 $0 start 43 echo "done." 44 ;; 45 *) 46 echo "Usage: smb {start|stop|restart|status}" 47 exit 1 48esac 49 50