#! /bin/bash # # samba4 Bring up/down samba4 service # # chkconfig: - 90 10 # description: Activates/Deactivates all samba4 interfaces configured to \ # start at boot time. # ### BEGIN INIT INFO # Provides: samba4 # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Enable service provided by daemon. ### END INIT INFO # Source function library. export SAMBA4PATH="/usr/sbin/samba" if [ -f /etc/sysconfig/samba4 ]; then . /etc/sysconfig/samba4 fi CWD=$(pwd) prog="samba4" start() { # Attach irda device echo -n $"Starting $prog: " ${SAMBA4PATH} sleep 2 if [ "`ps ax | grep -v \"grep\" | grep ${SAMBA4PATH}`" != "" ] ; then echo -n "succuess"; else echo -n "failure"; fi echo } stop() { # Stop service. echo -n $"Shutting down $prog: " killall samba sleep 2 if [ "`ps ax | grep -v \"grep\" | grep ${SAMBA4PATH}`" = "" ] ; then echo -n "succuess"; else echo -n "failure"; fi echo } status() { ${SAMBA4PATH} --show-build } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status irattach ;; restart|reload) stop start ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit 1 esac exit 0