diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-12-31 17:29:39 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-12-31 17:29:39 -0300 |
commit | 6f102d1647580e0bb9513c124b26a64c77da4f15 (patch) | |
tree | 0340f1f588be251183fe2b251bdba778f2c85c22 /pcr/samba4/samba4.rc | |
parent | 433900b14f11dc9ee55b72e8e5946bf47f65b636 (diff) | |
parent | b6cb10de275cea63bab0bee2a98342afa4fdc4ee (diff) | |
download | abslibre-6f102d1647580e0bb9513c124b26a64c77da4f15.tar.gz abslibre-6f102d1647580e0bb9513c124b26a64c77da4f15.tar.bz2 abslibre-6f102d1647580e0bb9513c124b26a64c77da4f15.zip |
Merge branch 'master' of ssh://gparabola/srv/git/abslibre
Diffstat (limited to 'pcr/samba4/samba4.rc')
-rw-r--r-- | pcr/samba4/samba4.rc | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/pcr/samba4/samba4.rc b/pcr/samba4/samba4.rc new file mode 100644 index 000000000..73d09fe30 --- /dev/null +++ b/pcr/samba4/samba4.rc @@ -0,0 +1,50 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +[ -f /etc/conf.d/samba4 ] && . /etc/conf.d/samba4 + +function call_samba4() { + /opt/samba4/sbin/samba -D $SAMBA4_ARGS +} + +case "$1" in + start) + stat_busy "Starting Samba4 Server" + if [ ! -x /opt/samba4/var ] ; then + install -m755 -d /opt/samba4/var + fi + if [ ! -x /opt/samba4/var/run ] ; then + install -m755 -d /opt/samba4/var/run + fi + PID=`pidof -o %PPID /opt/samba4/sbin/samba` + [ -z "$PID" ] && call_samba4 + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon samba4 + stat_done + fi + ;; + stop) + stat_busy "Stopping Samba4 Server" + PID=`pidof -o %PPID /opt/samba4/sbin/samba` + [ -z "$PID" ] || kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm /opt/samba4/var/run/samba.pid &> /dev/null + rm_daemon samba4 + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 |