aboutsummaryrefslogtreecommitdiffstats
path: root/testing/quicktun/quicktun.initd
blob: 0564c3e002215b2eb7de263f55d0a38793c239a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/sbin/openrc-run

VPN=${SVCNAME#*.}
if [ ${SVCNAME} != "quicktun" ]; then
  pidfile="/var/run/quicktun.${VPN}.pid"
else
  pidfile="/var/run/quicktun.pid"
fi

command=/usr/bin/quicktun

start() {
  if [ -e "/etc/quicktun/${VPN}.conf" ]
  then
    source "/etc/quicktun/${VPN}.conf"
  else
    eerror "Config /etc/quicktun/${VPN}.conf not found"
    exit 1
  fi

  ebegin "Starting ${SVCNAME}"
  start-stop-daemon --start --exec ${command} --pidfile ${pidfile} \
    --background --make-pidfile
  eend $?
}