summaryrefslogtreecommitdiffstats
path: root/openwrt/package/samba/files/samba.init
blob: c3c600ae3eb6ab0ed7f5c8682c223e77df47f69a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

DEFAULT=/etc/default/samba
RUN_D=/var/run/samba
NMBD_PID_F=$RUN_D/nmbd.pid
SMBD_PID_F=$RUN_D/smbd.pid
[ -f $DEFAULT ] && . $DEFAULT

case $1 in
 start)
  mkdir -p $RUN_D
  nmbd -D $NMBD_OPTIONS
  smbd -D $SMBD_OPTIONS
  ;;
 stop)
  [ -f $SMBD_PID_F ] && kill $(cat $SMBD_PID_F)
  [ -f $NMBD_PID_F ] && kill $(cat $NMBD_PID_F)
  ;;
 *)
  echo "usage: $0 (start|stop)"
  exit 1
esac

exit $?