From 3636e1dd5cbba36309207826e40b222cca853297 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 7 Jul 2009 15:34:23 -0700 Subject: Fix descriptions with meta-characters Bug 4672 Use ip command rather than sysfs to avoid quoting issues (cherry picked from commit 1b4902564b5a853b925d2c239c8e6a39b1734433) --- templates/interfaces/bonding/node.tag/description/node.def | 2 +- templates/interfaces/bonding/node.tag/vif/node.tag/description/node.def | 2 +- templates/interfaces/bridge/node.tag/description/node.def | 2 +- templates/interfaces/pseudo-ethernet/node.tag/description/node.def | 2 +- templates/interfaces/tunnel/node.tag/description/node.def | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/templates/interfaces/bonding/node.tag/description/node.def b/templates/interfaces/bonding/node.tag/description/node.def index d7becd13..1fcca391 100644 --- a/templates/interfaces/bonding/node.tag/description/node.def +++ b/templates/interfaces/bonding/node.tag/description/node.def @@ -1,4 +1,4 @@ type: txt help: Set description for this interface -update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../@)/ifalias" +update: sudo ip li set dev $VAR(../@) alias "$VAR(@)" delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias" diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/description/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/description/node.def index 40f04bcc..26195fcc 100644 --- a/templates/interfaces/bonding/node.tag/vif/node.tag/description/node.def +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/description/node.def @@ -1,4 +1,4 @@ type: txt help: Set description for this interface -update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../../@).$VAR(../@)/ifalias" +update: sudo ip li set dev "$VAR(../../@).$VAR(../@)" alias "$VAR(@)" delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../../@).$VAR(../@)/ifalias" diff --git a/templates/interfaces/bridge/node.tag/description/node.def b/templates/interfaces/bridge/node.tag/description/node.def index d7becd13..1fcca391 100644 --- a/templates/interfaces/bridge/node.tag/description/node.def +++ b/templates/interfaces/bridge/node.tag/description/node.def @@ -1,4 +1,4 @@ type: txt help: Set description for this interface -update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../@)/ifalias" +update: sudo ip li set dev $VAR(../@) alias "$VAR(@)" delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias" diff --git a/templates/interfaces/pseudo-ethernet/node.tag/description/node.def b/templates/interfaces/pseudo-ethernet/node.tag/description/node.def index d7becd13..1fcca391 100644 --- a/templates/interfaces/pseudo-ethernet/node.tag/description/node.def +++ b/templates/interfaces/pseudo-ethernet/node.tag/description/node.def @@ -1,4 +1,4 @@ type: txt help: Set description for this interface -update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../@)/ifalias" +update: sudo ip li set dev $VAR(../@) alias "$VAR(@)" delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias" diff --git a/templates/interfaces/tunnel/node.tag/description/node.def b/templates/interfaces/tunnel/node.tag/description/node.def index d7becd13..1fcca391 100644 --- a/templates/interfaces/tunnel/node.tag/description/node.def +++ b/templates/interfaces/tunnel/node.tag/description/node.def @@ -1,4 +1,4 @@ type: txt help: Set description for this interface -update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../@)/ifalias" +update: sudo ip li set dev $VAR(../@) alias "$VAR(@)" delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias" -- cgit v1.2.3