init script cleanup, use /etc/rc.d/ for enabled scripts, /etc/init.d/<pkgname> (enabl...
[openwrt/svn-archive/archive.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
9 start() {
10 [ -f $DEFAULT ] && . $DEFAULT
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