[packages] pepperspot: use service wrappers, use network.sh to find ip address
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 28 May 2012 15:20:46 +0000 (15:20 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 28 May 2012 15:20:46 +0000 (15:20 +0000)
SVN-Revision: 31946

net/pepperspot/Makefile
net/pepperspot/files/pepperspot.init

index 9f29b434794d6aaba814c55eaa31b60bce910ff9..4c8aafb89f7a014dd329f3876e768d54bda94c0d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2010 OpenWrt.org
+# Copyright (C) 2008-2012 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pepperspot
 PKG_VERSION:=0.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/pepperspot
index e5bd265ab4ecd1d041b9b6b1f70bdeb1471b1582..a1d57a8667e29182dd444ddcc893798728e0b794 100644 (file)
@@ -1,20 +1,19 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2008 OpenWrt.org
+# Copyright (C) 2008-2012 OpenWrt.org
+
 START=50
 
-RUN_D=/var/run
-PID_F=$RUN_D/pepper.pid
+SERVICE_USE_PID=1
+SERVICE_PID_FILE=/var/run/pepper.pid
 
 start() {
-       include /lib/network
-       scan_interfaces
-       /sbin/insmod tun >/dev/null 2>&1
-       /sbin/insmod ipv6 >/dev/null 2>&1
-       [ -d $RUN_D ] || mkdir -p $RUN_D
-       config_get ipaddr lan ipaddr
-       /usr/sbin/pepper --dns1="$ipaddr"
+       . /lib/functions/network.sh
+
+       local ipaddr
+       network_get_ipaddr ipaddr lan && \
+               service_start /usr/sbin/pepper --dns1="$ipaddr"
 }
 
 stop() {
-       [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
+       service_stop /usr/sbin/pepper
 }