2006-10-04 20:57:49 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
2006-08-25 13:01:56 +00:00
|
|
|
|
|
|
|
DEFAULT=/etc/default/samba
|
|
|
|
RUN_D=/var/run/samba
|
|
|
|
NMBD_PID_F=$RUN_D/nmbd.pid
|
|
|
|
SMBD_PID_F=$RUN_D/smbd.pid
|
|
|
|
|
2007-04-10 11:01:17 +00:00
|
|
|
. /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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
start() {
|
2006-10-15 21:03:30 +00:00
|
|
|
[ -f $DEFAULT ] && . $DEFAULT
|
2007-04-10 11:01:17 +00:00
|
|
|
config_load timezone&
|
2006-10-04 20:57:49 +00:00
|
|
|
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)
|
|
|
|
}
|
2006-08-25 13:01:56 +00:00
|
|
|
|