0f75b2635e
'echo -n' is not a POSIX construct (no flag support), we shoud use 'printf', especially in init script. This patch was generated by the following command line: git grep -l 'echo -n' -- `git ls-files | grep -v 'patch'` | xargs sed -i 's/echo -n/printf/' Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
82 lines
1.1 KiB
Bash
Executable File
82 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Stolen from RedHat FC5.
|
|
#
|
|
|
|
# Check that smb.conf exists.
|
|
[ -f /etc/samba/smb.conf ] || exit 0
|
|
|
|
# Make directories.
|
|
mkdir -p /var/cache/samba
|
|
mkdir -p /var/log/samba
|
|
mkdir -p /var/lock/subsys
|
|
mkdir -p /var/run/samba
|
|
|
|
RETVAL=0
|
|
|
|
start() {
|
|
printf "Starting SMB services: "
|
|
smbd -D
|
|
RETVAL=$?
|
|
echo "done"
|
|
|
|
printf "Starting NMB services: "
|
|
nmbd -D
|
|
RETVAL2=$?
|
|
echo "done"
|
|
|
|
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \
|
|
RETVAL=1
|
|
return $RETVAL
|
|
}
|
|
|
|
stop() {
|
|
printf "Shutting down SMB services: "
|
|
kill -9 `pidof smbd`
|
|
RETVAL=$?
|
|
rm -f /var/run/samba/smbd.pid
|
|
echo "done"
|
|
|
|
printf "Shutting down NMB services: "
|
|
kill -9 `pidof nmbd`
|
|
RETVAL2=$?
|
|
rm -f /var/run/samba/nmbd.pid
|
|
|
|
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
|
|
echo "done"
|
|
return $RETVAL
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
reload() {
|
|
printf "Reloading smb.conf file: "
|
|
kill -HUP `pidof smbd`
|
|
RETVAL=$?
|
|
echo "done"
|
|
return $RETVAL
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart)
|
|
restart
|
|
;;
|
|
reload)
|
|
reload
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|reload}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|