5529b91de07ff8ed28f1334a10f10dee144ef9cb
[openwrt/svn-archive/archive.git] / net / openvpn / files / openvpn.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2007 OpenWrt.org
3
4 START=70
5 BIN=openvpn
6 DEFAULT=/etc/default/$BIN
7 RUN_D=/var/run
8 PID_F=$RUN_D/$BIN.pid
9
10 start() {
11 [ -f $DEFAULT ] && . $DEFAULT
12 mkdir -p $RUN_D
13 $BIN --writepid $RUN_D/$BIN.pid --daemon $OPTIONS
14 }
15
16 stop() {
17 [ -f $PID_F ] && kill $(cat $PID_F)
18 }