#! /bin/sh # Copyright (c) 1996 StarDivision GmbH. All rights reserved. # Copyright (c) 1996 S.u.S.E. Gmbh Fuerth, Germany. All rights reserved. # # Author: Bastian Epting, StarDivision GmbH # Florian La Roche, # Volker Lendecke, # . /etc/rc.config # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START_SAMBA=yes test "$START_SAMBA" = "yes" || exit 0 # The echo return value for success (defined in /etc/rc.config). return=$rc_done case "$1" in start) echo -n "Starting SAMBA:" startproc /usr/local/samba/current/sbin/nmbd -D -s /etc/samba/samba.conf || return=$rc_failed startproc /usr/local/samba/current/sbin/smbd -D -s /etc/samba/samba.conf || return=$rc_failed echo -e "$return" ;; stop) echo -n "Shutting down SAMBA:" killproc -TERM /usr/local/samba/current/sbin/nmbd || return=$rc_failed killproc -TERM /usr/local/samba/current/sbin/smbd || return=$rc_failed echo -e "$return" ;; restart|reload) $0 stop && $0 start || return=$rc_failed ;; status) echo -n "Checking for service SAMBA: " checkproc /usr/local/samba/current/sbin/nmbd && echo -n "OK " || echo -n "No process " checkproc /usr/local/samba/current/sbin/smbd && echo "OK " || echo "No process" ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1 esac # Inform the caller not only verbosely and set an exit status. test "$return" = "$rc_done" || exit 1 exit 0