[packages] chillispot: use service wrappers, use network.sh to find ip address

git-svn-id: svn://svn.openwrt.org/openwrt/packages@31951 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2012-05-28 15:45:55 +00:00
parent 332bf9532e
commit 9e2b1471e7
2 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2006-2010 OpenWrt.org # Copyright (C) 2006-2012 OpenWrt.org
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=chillispot PKG_NAME:=chillispot
PKG_VERSION:=1.1.0 PKG_VERSION:=1.1.0
PKG_RELEASE:=3 PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.chillispot.info/download PKG_SOURCE_URL:=http://www.chillispot.info/download

View File

@ -1,19 +1,19 @@
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org # Copyright (C) 2006-2012 OpenWrt.org
START=50 START=50
RUN_D=/var/run SERVICE_USE_PID=1
PID_F=$RUN_D/chilli.pid SERVICE_PID_FILE=/var/run/chilli.pid
start() { start() {
include /lib/network . /lib/functions/network.sh
scan_interfaces
/sbin/insmod tun >/dev/null 2>&1 local ipaddr
[ -d $RUN_D ] || mkdir -p $RUN_D network_get_ipaddr ipaddr lan && \
config_get ipaddr lan ipaddr service_start /usr/sbin/chilli --dns1="$ipaddr"
/usr/sbin/chilli --dns1="$ipaddr"
} }
stop() { stop() {
[ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1 service_stop /usr/sbin/chilli
} }