packages/net/samba/files/samba.init
florian 2e888a1e2b Fix samba errors where it cannot load the timezone, configurable through kamikaze configuration
git-svn-id: svn://svn.openwrt.org/openwrt/packages@6921 3c298f89-4303-0410-b956-a3cf2f4a3e73
2007-04-10 11:01:17 +00:00

38 lines
785 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/samba
RUN_D=/var/run/samba
NMBD_PID_F=$RUN_D/nmbd.pid
SMBD_PID_F=$RUN_D/smbd.pid
. /etc/functions.sh
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)
}