packages/net/xl2tpd/files/xl2tpd.init
jow b5cf975c7c packages/net/xl2tpd: netifd support
This integrates xl2tpd suppport into netifd, based on what I saw for ppp and pptp.
I also changed the init script so that it makes sure that all modules needed for
kernel-mode l2tp support are loaded at the time that xl2tpd is started, as
otherwise xl2tpd falls back into using user-mode l2tp.

Signed-off-by: Daniel Golle <dgolle@allnet.de>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@32563 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-07-01 10:38:45 +00:00

29 lines
610 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2010 OpenWrt.org
START=60
BIN=xl2tpd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
# make sure kernel modules are loaded before starting xl2tpd, otherwise
# kernel-mode l2tp support won't work
local load
for module in slhc ppp_generic ppp_async pppox l2tp_core l2tp_netlink l2tp_ppp ; do
grep -q "$module" /proc/modules && continue
/sbin/insmod $module 2>&- >&-
load=1
done
[ "$load" = "1" ] && sleep 1
mkdir -p $RUN_D/$BIN
[ -f $DEFAULT ] && . $DEFAULT
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}