#!/bin/sh # # Author: Arno, 2011 # # /etc/init.d/samba # and its symbolic link # /{not used} # # pptpd Starts and stops the Samba smbd/nmbd daemon \ # used to provide SMB network services. # # changes 20110729, created the script. ### BEGIN INIT INFO # Provides: samba # Required-Start: $network # Required-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: start/stops samba services. # Description: Start and stops the services smbd and nmbd. ### END INIT INFO # Source function library. if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 1 fi # Avoid using root's TMPDIR unset TMPDIR # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 1 # Check that smb.conf exists. [ -f /etc/samba/smb.conf ] || exit 6 RETVAL=0 case "$1" in start) service smb start service nmb start ;; stop) service smb stop service nmb stop ;; restart) service samba stop service samba start ;; reload) service smb reload service nmb reload ;; status) service smb status service nmb status ;; condrestart) service smb condrestart service nmb condrestart ;; *) echo $"Description: $0 Starting and stopping smb and nmb daemon" echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}" exit 2 esac exit $RETVAL