summaryrefslogtreecommitdiff
path: root/package/base-files/extra/etc/network/if-pre-up.d/01-atm
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2009-12-29 01:04:10 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2009-12-29 01:04:10 +0100
commit08409051bea263523a0883b2fc3167d1da3612b4 (patch)
treed4aab582e33bd20ff4c14a71d33f008b0fb1e690 /package/base-files/extra/etc/network/if-pre-up.d/01-atm
parent00ba3e5ce046f7f8d140321e18985048dbfb54f6 (diff)
add atm network script
order network scripts. Add atm example. enable reboot option for mtd.
Diffstat (limited to 'package/base-files/extra/etc/network/if-pre-up.d/01-atm')
-rw-r--r--package/base-files/extra/etc/network/if-pre-up.d/01-atm43
1 files changed, 43 insertions, 0 deletions
diff --git a/package/base-files/extra/etc/network/if-pre-up.d/01-atm b/package/base-files/extra/etc/network/if-pre-up.d/01-atm
new file mode 100644
index 000000000..08baf73c7
--- /dev/null
+++ b/package/base-files/extra/etc/network/if-pre-up.d/01-atm
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+if [ ! -x /usr/sbin/br2684ctl ]
+then
+ exit 0
+fi
+
+[ "$METHOD" == "atm" ] || exit 0
+
+[ "$IF_ATM_ENCAPS" ] || encap=0
+[ "$IF_ATM_PAYLOAD" ] || payload=1
+[ "$IF_ATM_VPI" ] || $IF_ATM_VPI=1
+[ "$IF_ATM_VCI" ] || $IF_ATM_VCI=32
+
+case "$IF_ATM_PAYLOAD" in
+bridged)
+ payload=1
+ ;;
+routed)
+ payload=0
+ ;;
+*)
+ echo "Wrong payload, use either bridged or routed"
+ exit 1
+ ;;
+esac
+
+case "$IF_ATM_ENCAPS" in
+llc)
+ encap=0
+ ;;
+vc)
+ encap=1
+ ;;
+*)
+ echo "Wrong Encapsulation use either llc or vc"
+ exit 1
+ ;;
+esac
+
+br2684ctl -b -c 0 -e $encap -p $payload -a $IF_ATM_VPI.$IF_ATM_VCI
+ifconfig nas0 up
+exit 0