summaryrefslogtreecommitdiff
path: root/templates/interfaces/ethernet
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-06-15 10:08:16 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-06-15 10:08:16 -0700
commite24523cda77d3277844bfe638c086bcf85348f7d (patch)
treefc7ade77758bb9ccc696e30fa2029b1389117dfd /templates/interfaces/ethernet
parent094222202c56bff9ddabf591a9429fea19e3d185 (diff)
downloadvyatta-cfg-quagga-e24523cda77d3277844bfe638c086bcf85348f7d.tar.gz
vyatta-cfg-quagga-e24523cda77d3277844bfe638c086bcf85348f7d.zip
Remove sudo from ip command
No longer need sudo on ip because of cap_net_admin
Diffstat (limited to 'templates/interfaces/ethernet')
-rw-r--r--templates/interfaces/ethernet/node.def4
-rw-r--r--templates/interfaces/ethernet/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/ethernet/node.tag/mtu/node.def4
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.def6
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def4
5 files changed, 11 insertions, 11 deletions
diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def
index 0b67836b..05b2e03c 100644
--- a/templates/interfaces/ethernet/node.def
+++ b/templates/interfaces/ethernet/node.def
@@ -12,7 +12,7 @@ syntax:expression: exec \
echo \"interface ethernet $VAR(@): does not exist\";
exit 1; \
fi"
-create: sudo ip link set "$VAR(@)" up
+create: ip link set "$VAR(@)" up
/opt/vyatta/sbin/vyatta-link-detect $VAR(@) on
delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0
- sudo ip link set $VAR(@) down
+ ip link set $VAR(@) down
diff --git a/templates/interfaces/ethernet/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/disable/node.def
index fbfb155a..5fe2b748 100644
--- a/templates/interfaces/ethernet/node.tag/disable/node.def
+++ b/templates/interfaces/ethernet/node.tag/disable/node.def
@@ -1,12 +1,12 @@
help: Set interface disabled
create: /etc/netplug/linkdown.d/dhclient $VAR(../@)
- if ! sudo ip link set $VAR(../@) down 2>/dev/null; then
+ if ! ip link set $VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../@)
exit 1
fi
delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0
- if ! sudo ip link set $VAR(../@) up; then
+ if ! ip link set $VAR(../@) up; then
echo "Error enabling dev $VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/ethernet/node.tag/mtu/node.def b/templates/interfaces/ethernet/node.tag/mtu/node.def
index dc03ae16..f33158f8 100644
--- a/templates/interfaces/ethernet/node.tag/mtu/node.def
+++ b/templates/interfaces/ethernet/node.tag/mtu/node.def
@@ -1,8 +1,8 @@
type: u32
help: Set the Maximum Transmission Unit (MTU) for this interface
syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000"
-update: if ! sudo ip link set $VAR(../@) mtu $VAR(@)
+update: if ! ip link set $VAR(../@) mtu $VAR(@)
then echo "Error setting MTU on dev $VAR(../@)"; exit 1
fi
delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0
- sudo ip link set $VAR(../@) mtu 1500
+ ip link set $VAR(../@) mtu 1500
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.def b/templates/interfaces/ethernet/node.tag/vif/node.def
index b6b8abc7..c14ed002 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.def
@@ -5,17 +5,17 @@ help: Set Virtual Local Area Network (VLAN) ID
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094"
-create: if ! sudo ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
+create: if ! ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
then echo "Error creating VLAN device $VAR(../@).$VAR(@)"
exit 1
fi
# if parent is up, then bring VLAN up
if [ $(( $(cat /sys/class/net/$VAR(../@)/flags) & 1 )) -eq 1 ]; then
- sudo ip link set "$VAR(../@).$VAR(@)" up
+ ip link set "$VAR(../@).$VAR(@)" up
fi
/opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on
delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0
- sudo ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
+ ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
comp_help: possible completions:
<0-4094> Set VLAN ID
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def
index 78b24870..b2119c9c 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def
@@ -1,11 +1,11 @@
help: Set interface disabled
update: /etc/netplug/linkdown.d/dhclient $VAR(../../@).$VAR(../@)
- if ! sudo ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
+ if ! ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../../@).$VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../../@).$VAR(../@)
exit 1
fi
-delete: if ! sudo ip link set $VAR(../../@).$VAR(../@) up; then
+delete: if ! ip link set $VAR(../../@).$VAR(../@) up; then
echo "Error enabling dev $VAR(../../@).$VAR(../@)"
exit 1
fi