port lots of init scripts over to rc.common (more to come)
[packages.git] / net / chillispot / files / chillispot.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 RUN_D=/var/run
5 PID_F=$RUN_D/chilli.pid
6
7 start() {
8         include /lib/network
9         scan_interfaces
10         /sbin/insmod tun >/dev/null 2>&1
11         [ -d $RUN_D ] || mkdir -p $RUN_D
12         config_get ipaddr lan ipaddr
13         /usr/sbin/chilli --dns1="$ipaddr"
14 }
15
16 stop() {
17         [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
18 }