From 93719883d649d7c21fcb9d193caeea2cb214c221 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 7 Jul 2009 14:44:58 -0700 Subject: Use ip command rather than sysfs to set ifalias Bug 4672 By using ip command instead of sysfs, avoid subshell quoting issues. (cherry picked from commit 1755bfab4b22cc822f96fb78a1e05392d5f07398) --- templates/interfaces/ethernet/node.tag/description/node.def | 2 +- .../interfaces/ethernet/node.tag/vif/node.tag/description/node.def | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'templates/interfaces/ethernet') diff --git a/templates/interfaces/ethernet/node.tag/description/node.def b/templates/interfaces/ethernet/node.tag/description/node.def index d7becd1..ccec5e1 100644 --- a/templates/interfaces/ethernet/node.tag/description/node.def +++ b/templates/interfaces/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 link set $VAR(../@) alias "$VAR(@)" delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias" diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def index 40f04bc..fda2e3c 100644 --- a/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def +++ b/templates/interfaces/ethernet/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 link set dev "$VAR(../../@).$VAR(../@)" alias "$VAR(@)" delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../../@).$VAR(../@)/ifalias" -- cgit v1.2.3