packages/net/samba/files/samba.init
florian 47b6b9ba70 [package] increase samba/samba3 init script priority (#4697)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@14667 3c298f89-4303-0410-b956-a3cf2f4a3e73
2009-02-26 11:32:20 +00:00

37 lines
759 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=60
DEFAULT=/etc/default/samba
RUN_D=/var/run/samba
NMBD_PID_F=$RUN_D/nmbd.pid
SMBD_PID_F=$RUN_D/smbd.pid
config_cb() {
local cfg="$CONFIG_SECTION"
local cfgtype
config_get cfgtype "$cfg" TYPE
case "$cfgtype" in
timezone)
config_get posixtz $cfg posixtz
config_get zoneinfo $cfg zoneinfo
echo "$posixtz" > /etc/TZ
;;
esac
}
start() {
[ -f $DEFAULT ] && . $DEFAULT
config_load timezone&
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)
}