summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-05-21 17:19:28 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-05-21 17:19:28 -0700
commit60fb7bb1025d25606efc00b4f3f9505e17efe1e0 (patch)
tree4cbf203b17cc225ec712bcf43ec7b5c7f50c6a52 /scripts
parent3f8a97bceab1e36b8f272949d23bbb2e46bafc77 (diff)
downloadvyatta-cfg-quagga-60fb7bb1025d25606efc00b4f3f9505e17efe1e0.tar.gz
vyatta-cfg-quagga-60fb7bb1025d25606efc00b4f3f9505e17efe1e0.zip
Use net_set to avoid using sudo
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-link-detect9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/vyatta-link-detect b/scripts/vyatta-link-detect
index 9dc17e05..078053cc 100755
--- a/scripts/vyatta-link-detect
+++ b/scripts/vyatta-link-detect
@@ -17,16 +17,15 @@ fi
# 0 - always receive
# 1 - ignore receive if admin_down
# 2 - ignore receive if admin_down or link down
-set-sysctl () {
- sudo sh -c "echo $2 >/proc/sys/net/ipv4/conf/$1/link_filter"
-# sudo sh -c "echo $2 >/proc/sys/net/ipv6/conf/$1/link_filter"
+set_linkfilter () {
+ net_set /proc/sys/net/ipv4/conf/$1/link_filter=$2
}
case $2 in
-on) set-sysctl $1 2
+on) set_linkfilter $1 2
exec vtysh -c "configure terminal" -c "interface $1" \
-c "link-detect" ;;
-off) set-sysctl $1 1
+off) set_linkfilter $1 1
exec vtysh -c "configure terminal" -c "interface $1" \
-c "no link-detect" ;;
*) usage;;