#!/bin/sh /etc/rc.common
+
START=46
STOP=46
start_service() {
local section="$1"
-
- include /lib/network
- scan_interfaces
- config_load /var/state/network
- config_get LAN lan ifname
- config_get tnlifname "$section" tnlifname
+ . /lib/functions/network.sh
+
+ network_get_device LAN lan || return 1
+ config_get tnlifname "$section" tnlifname
config_get remoteip4 "$section" remoteip4
config_get localip4 "$section" localip4
config_get localip6 "$section" localip6
stop_service() {
local section="$1"
-
- include /lib/network
- scan_interfaces
- config_load /var/state/network
- config_get LAN lan ifname
- config_get tnlifname "$section" tnlifname
+ . /lib/functions/network.sh
+
+ network_get_device LAN lan || return 1
+ config_get tnlifname "$section" tnlifname
config_get remoteip4 "$section" remoteip4
config_get localip4 "$section" localip4
config_get localip6 "$section" localip6
start() {
if ! [ -x /usr/sbin/ip ]; then
echo "ip is required to setup the tunnel";
- exit 1;
+ exit 1
fi
config_load "6tunnel"
config_foreach start_service 6tunnel
}
-stop () {
+stop() {
config_load "6tunnel"
config_foreach stop_service 6tunnel
}