summaryrefslogtreecommitdiffhomepage
path: root/proto
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-09-11 16:37:48 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-09-11 16:37:48 +0200
commit7ecca4a6852a69ecbbdf5d831fda329612e2388b (patch)
treea9a07eb07e4417bbec092bc2fc294777b51f02f8 /proto
parentf782148ef2be32343f13b033c0df04a56fb9c38e (diff)
proto-shell: pass the interface name to plugins
Diffstat (limited to 'proto')
-rwxr-xr-xproto/netifd-proto.sh13
-rwxr-xr-xproto/ppp.sh4
2 files changed, 9 insertions, 8 deletions
diff --git a/proto/netifd-proto.sh b/proto/netifd-proto.sh
index 93bf37a..d15505c 100755
--- a/proto/netifd-proto.sh
+++ b/proto/netifd-proto.sh
@@ -26,10 +26,11 @@ add_default_handler() {
esac
}
-proto="$1"
-cmd="$2"
-data="$3"
-ifname="$4"
+proto="$1"; shift
+cmd="$1"; shift
+interface="$1"; shift
+data="$1"; shift
+ifname="$1"; shift
case "$cmd" in
dump)
@@ -55,8 +56,8 @@ case "$cmd" in
[[ "$proto" == "$1" ]] || return 0
case "$cmd" in
- setup) eval "$1_setup \"\$data\" \"\$ifname\"" ;;
- teardown) eval "$1_teardown \"\$data\" \"\$ifname\"" ;;
+ setup) eval "$1_setup \"\$interface\" \"\$data\" \"\$ifname\"" ;;
+ teardown) eval "$1_teardown \"\$interface\" \"\$data\" \"\$ifname\"" ;;
*) return 1 ;;
esac
}
diff --git a/proto/ppp.sh b/proto/ppp.sh
index 428096b..8e8ceb2 100755
--- a/proto/ppp.sh
+++ b/proto/ppp.sh
@@ -9,7 +9,7 @@ ppp_init_config() {
}
ppp_setup() {
- echo "ppp_setup: $1"
+ echo "ppp_setup($1): $2"
}
ppp_teardown() {
@@ -32,7 +32,7 @@ pppoe_init() {
}
pppoe_setup() {
- echo "pppoe_setup($2): $1"
+ echo "pppoe_setup($1, $3): $2"
}
pppoe_teardown() {