diff options
Diffstat (limited to 'templates/interfaces/bonding')
7 files changed, 28 insertions, 28 deletions
diff --git a/templates/interfaces/bonding/node.def b/templates/interfaces/bonding/node.def index bb1b9ae3..4a944970 100644 --- a/templates/interfaces/bonding/node.def +++ b/templates/interfaces/bonding/node.def @@ -1,14 +1,15 @@ tag: priority: 315 type: txt -help: Set bonding interface +help: Set bonding interface name +comp_help: Enter bonding interface name (bond0 - bond99) syntax:expression: pattern $VAR(@) "^bond[0-9]+$" \ ; "bonding must be (bond0-bond99)" begin: if [ ! -f /sys/class/net/bonding_masters ]; then sudo modprobe bonding max_bonds=0 miimon=250 fi create: sudo sh -c "echo +$VAR(@) > /sys/class/net/bonding_masters" || exit 1 - sudo ip link set "$VAR(@)" up + ip link set "$VAR(@)" up /opt/vyatta/sbin/vyatta-link-detect $VAR(@) on delete: SLAVES=`cat /sys/class/net/$VAR(@)/bonding/slaves`; if [ -z "$SLAVES" ] @@ -18,4 +19,3 @@ delete: SLAVES=`cat /sys/class/net/$VAR(@)/bonding/slaves`; echo "bonded interface $VAR(@) still has slaves: $SLAVES" exit 1; fi -comp_help: Enter bond interface name (bond0 - bond99) diff --git a/templates/interfaces/bonding/node.tag/bridge-group/node.def b/templates/interfaces/bonding/node.tag/bridge-group/node.def index 940295fa..9ce97b1b 100644 --- a/templates/interfaces/bonding/node.tag/bridge-group/node.def +++ b/templates/interfaces/bonding/node.tag/bridge-group/node.def @@ -12,13 +12,13 @@ end: exit 1 else echo "Adding interface $bondif to bridge $newbridge." - sudo brctl addif $newbridge $bondif; + /usr/sbin/brctl addif $newbridge $bondif; if [ -n "$VAR(./cost/@)" ]; then - sudo brctl setpathcost $newbridge $bondif $VAR(./cost/@); + /usr/sbin/brctl setpathcost $newbridge $bondif $VAR(./cost/@); fi; if [ -n "$VAR(./priority/@)" ]; then - sudo brctl setportprio $newbridge $bondif $VAR(./priority/@); + /usr/sbin/brctl setportprio $newbridge $bondif $VAR(./priority/@); fi fi elif [ ${COMMIT_ACTION} = 'DELETE' ]; then @@ -32,7 +32,7 @@ end: # it gets deleted before the removal of bridge-groups under interfaces exit 0 else - sudo brctl delif $oldbridge $bondif + /usr/sbin/brctl delif $oldbridge $bondif fi else if [ -z "$newbridge" ]; then @@ -46,15 +46,15 @@ end: if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \ --bridge-notin-proposedcfg \ --bridge-interface="$oldbridge"; then \ - sudo brctl delif $oldbridge $bondif + /usr/sbin/brctl delif $oldbridge $bondif fi - sudo brctl addif $newbridge $bondif + /usr/sbin/brctl addif $newbridge $bondif fi if [ -n "$VAR(./cost/@)" ]; then - sudo brctl setpathcost $newbridge $bondif $VAR(./cost/@) + /usr/sbin/brctl setpathcost $newbridge $bondif $VAR(./cost/@) fi if [ -n "$VAR(./priority/@)" ]; then - sudo brctl setportprio $newbridge $bondif $VAR(./priority/@) + /usr/sbin/brctl setportprio $newbridge $bondif $VAR(./priority/@) fi fi fi diff --git a/templates/interfaces/bonding/node.tag/disable/node.def b/templates/interfaces/bonding/node.tag/disable/node.def index ad033365..96325d72 100644 --- a/templates/interfaces/bonding/node.tag/disable/node.def +++ b/templates/interfaces/bonding/node.tag/disable/node.def @@ -1,11 +1,11 @@ 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: if ! sudo ip link set $VAR(../@) up; then +delete: if ! ip link set $VAR(../@) up; then echo "Error enabling dev $VAR(../@)" exit 1 fi diff --git a/templates/interfaces/bonding/node.tag/mtu/node.def b/templates/interfaces/bonding/node.tag/mtu/node.def index 07c102ac..cd244402 100644 --- a/templates/interfaces/bonding/node.tag/mtu/node.def +++ b/templates/interfaces/bonding/node.tag/mtu/node.def @@ -1,5 +1,5 @@ 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:expression: "sudo ip link set $VAR(../@) mtu $VAR(@)"; "Error setting MTU on dev $VAR(../@)" -delete:expression: "sudo ip link set $VAR(../@) mtu 1500"; "Error deleting MTU on dev $VAR(../@)" +update: ip link set $VAR(../@) mtu $VAR(@) +delete: ip link set $VAR(../@) mtu 1500 diff --git a/templates/interfaces/bonding/node.tag/vif/node.def b/templates/interfaces/bonding/node.tag/vif/node.def index 2e718f41..62e7ab95 100644 --- a/templates/interfaces/bonding/node.tag/vif/node.def +++ b/templates/interfaces/bonding/node.tag/vif/node.def @@ -8,9 +8,9 @@ create: read -a SLAVES </sys/class/net/$VAR(../@)/bonding/slaves echo "Must configure slave devices for bond interface $VAR(../@) before adding vif" exit 1 fi - sudo ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1 - sudo ip link set "$VAR(../@).$VAR(@)" up + ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1 + ip link set "$VAR(../@).$VAR(@)" up sudo sh -c "/opt/vyatta/sbin/vyatta-link-detect $VAR(../@).$VAR(@) on" -delete: sudo ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@) +delete: ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@) comp_help: possible completions: <0-4094> Set VLAN ID diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/bridge-group/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/bridge-group/node.def index 04dc957b..42234106 100644 --- a/templates/interfaces/bonding/node.tag/vif/node.tag/bridge-group/node.def +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/bridge-group/node.def @@ -13,13 +13,13 @@ end: exit 1 else echo "Adding interface $bondif to bridge $newbridge." - sudo brctl addif $newbridge $bondif; + /usr/sbin/brctl addif $newbridge $bondif; if [ -n "$VAR(./cost/@)" ]; then - sudo brctl setpathcost $newbridge $bondif $VAR(./cost/@); + /usr/sbin/brctl setpathcost $newbridge $bondif $VAR(./cost/@); fi; if [ -n "$VAR(./priority/@)" ]; then - sudo brctl setportprio $newbridge $bondif $VAR(./priority/@); + /usr/sbin/brctl setportprio $newbridge $bondif $VAR(./priority/@); fi fi elif [ ${COMMIT_ACTION} = 'DELETE' ]; then @@ -33,7 +33,7 @@ end: # it gets deleted before the removal of bridge-groups under interfaces exit 0 else - sudo brctl delif $oldbridge $bondif + /usr/sbin/brctl delif $oldbridge $bondif fi else if [ -z "$newbridge" ]; then @@ -47,15 +47,15 @@ end: if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \ --bridge-notin-proposedcfg \ --bridge-interface="$oldbridge"; then \ - sudo brctl delif $oldbridge $bondif + /usr/sbin/brctl delif $oldbridge $bondif fi - sudo brctl addif $newbridge $bondif + /usr/sbin/brctl addif $newbridge $bondif fi if [ -n "$VAR(./cost/@)" ]; then - sudo brctl setpathcost $newbridge $bondif $VAR(./cost/@) + /usr/sbin/brctl setpathcost $newbridge $bondif $VAR(./cost/@) fi if [ -n "$VAR(./priority/@)" ]; then - sudo brctl setportprio $newbridge $bondif $VAR(./priority/@) + /usr/sbin/brctl setportprio $newbridge $bondif $VAR(./priority/@) fi fi fi diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/disable/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/disable/node.def index 78b24870..b2119c9c 100644 --- a/templates/interfaces/bonding/node.tag/vif/node.tag/disable/node.def +++ b/templates/interfaces/bonding/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 |