summaryrefslogtreecommitdiff
path: root/net/samba-devel/files/samba.sh.sample
diff options
context:
space:
mode:
Diffstat (limited to 'net/samba-devel/files/samba.sh.sample')
-rw-r--r--net/samba-devel/files/samba.sh.sample21
1 files changed, 15 insertions, 6 deletions
diff --git a/net/samba-devel/files/samba.sh.sample b/net/samba-devel/files/samba.sh.sample
index 50b8968ec6c5..e6807ad6d145 100644
--- a/net/samba-devel/files/samba.sh.sample
+++ b/net/samba-devel/files/samba.sh.sample
@@ -1,13 +1,22 @@
#!/bin/sh
smbspool=/var/spool/samba
+pidfiledir=/var/run
smbd=/usr/local/sbin/smbd
nmbd=/usr/local/sbin/nmbd
-if [ -f $smbd ]; then
- if [ -d $smbspool ]; then
- rm -f $smbspool/*
+# start
+if [ "x$1" = "x" -o "x$1" = "xstart" ]; then
+ if [ -f $smbd ]; then
+ if [ -d $smbspool ]; then
+ rm -f $smbspool/*
+ fi
+ echo -n ' Samba'
+ $smbd -D
+ $nmbd -D
fi
- echo -n ' Samba'
- $smbd -D
- $nmbd -D
+
+# stop
+elif [ "x$1" = "xstop" ]; then
+ kill `cat $pidfiledir/smbd.pid`
+ kill `cat $pidfiledir/nmbd.pid`
fi