source: src/router/eop-tunnel/eop-tunnel.startup @ 18776

Last change on this file since 18776 was 18776, checked in by BrainSlayer, 14 months ago

fix path

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/sh
2nv=/usr/sbin/nvram
3/bin/mkdir -p /tmp/oet/pid
4cd /tmp/oet/pid
5for i in 1 2 3 4 5 6 7 8 9 10
6do
7        if test -e "${i}.pid"
8        then
9            /usr/sbin/brctl delif $(/sbin/getbridge oet${i}) oet${i} 2>&1 > /dev/null
10            /usr/sbin/ip tunnel del oet${i}
11            rm -f ${i}.pid
12        fi
13        if [ "$($nv get oet${i}_en)" = "1" ]
14        then
15                insmod etherip
16                if [ "$($nv get oet${i}_bridged)" = "1" ]
17                then
18                        /usr/sbin/ip tunnel add oet${i} mode etherip remote $($nv get oet${i}_rem) local any
19                        /usr/sbin/ip link set dev oet${i} up
20                        /sbin/ifconfig oet${i} up 2>&1 > /dev/null
21                        /sbin/ifconfig oet${i} promisc 2>&1 > /dev/null
22                        /usr/sbin/brctl addif $(/sbin/getbridge oet${i}) oet${i} 2>&1 > /dev/null
23                        /usr/sbin/brctl setportprio $(/sbin/getbridge oet${i}) oet${i} $(/sbin/getbridgeprio oet${i})
24                else
25                        /usr/sbin/ip tunnel add oet${i} mode etherip remote $($nv get oet${i}_rem) local $($nv get oet${i}_ipaddr)
26                        /usr/sbin/ip link set dev oet${i} up
27                        /usr/sbin/ip addr add $($nv get oet${i}_ipaddr)/$(getmask $($nv get oet${i}_netmask)) dev oet${i} 2>&1 > /dev/null
28                fi
29                echo enable > ${i}.pid
30        fi
31done
Note: See TracBrowser for help on using the repository browser.