port lots of init scripts over to rc.common (more to come)
[packages.git] / net / samba / files / samba.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 DEFAULT=/etc/default/samba
5 RUN_D=/var/run/samba
6 NMBD_PID_F=$RUN_D/nmbd.pid
7 SMBD_PID_F=$RUN_D/smbd.pid
8 [ -f $DEFAULT ] && . $DEFAULT
9
10 start() {
11         mkdir -p $RUN_D
12         nmbd -D $NMBD_OPTIONS
13         smbd -D $SMBD_OPTIONS
14 }
15 stop() {
16         [ -f $SMBD_PID_F ] && kill $(cat $SMBD_PID_F)
17         [ -f $NMBD_PID_F ] && kill $(cat $NMBD_PID_F)
18 }
19