#---------------------------------------------------------------------------- # /etc/rc0.d/rc400.samba - shut down samba # # Creation : 20.01.2003 knuffel # Last Update: $Id$ #---------------------------------------------------------------------------- colechobin='/usr/local/bin/colecho' $colechobin "shutting down samba ..." gn >/dev/console sambanetsendbin='/bin/samba-netsend' if [ -f /boot/rc.cfg ] then . /boot/rc.cfg fi if [ "$LOCALE" = "de" ] then message="fli4l-samba-server auf `hostname` wird nun heruntergefahren..." else message="fli4l-samba-server on `hostname` is going down now..." fi if [ -f "$sambanetsendbin" ] then "$sambanetsendbin" "all" "$message" fi if [ -n "`cat /proc/mounts | grep smbfs`" ] then cd / for i in `cat /proc/mounts | grep smbfs | cut -d" " -f2` do echo "umounting smb filesystem in $i..." smbumount $i if [ $? -eq 0 ] then $colechobin "smb filesystem in $i umounted" gn else $colechobin "cannot umount smb filesystem in $i!" br x br fi done fi #for i in smbfs nls_iso8859-1 nls_cp850 nls_iso8859-2 nls_iso8859-5 nls_iso8859-7 #do # if [ -n "`lsmod | grep $i`" ] # then # rmmod "$i" # if [ $? -eq 0 ] # then # $colechobin "$i unloaded" gn # else # $colechobin "cannot rmmod $i!" br x # fi # fi #done smbdstopped='no' if [ -n "`ps | grep [s]mbd`" ] then for i in `ps | grep [s]mbd | cut -c1-6` do kill -9 "$i" >/dev/null 2>&1 if [ $? -eq 0 ] then $colechobin "smbd with pid $i was stopped" gn smbdstopped='yes' else if [ "$smbdstopped" = "no" ] then $colechobin "cannot stop smbd with pid $i!" br x br fi fi done else $colechobin "smbd is not running!" br x br fi nmbdstopped='no' if [ -n "`ps | grep [n]mbd`" ] then for i in `ps | grep [n]mbd | cut -c1-6` do kill -9 "$i" >/dev/null 2>&1 if [ $? -eq 0 ] then $colechobin "nmbd with pid $i was stopped" gn nmbdstopped='yes' else if [ "$nmbdstopped" = "no" ] then $colechobin "cannot stop nmbd with pid $i!" br x br fi fi done else $colechobin "nmbd is not running!" br x br fi