diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-07-07 14:44:58 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2009-07-08 16:54:54 -0700 |
commit | 93719883d649d7c21fcb9d193caeea2cb214c221 (patch) | |
tree | 5c4f1e3855739aed5604a2254ba0d27aba302ac5 | |
parent | 0d9103716d32773bdb3cccaceeaeb50743d0cf11 (diff) | |
download | vyatta-cfg-93719883d649d7c21fcb9d193caeea2cb214c221.tar.gz vyatta-cfg-93719883d649d7c21fcb9d193caeea2cb214c221.zip |
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)
3 files changed, 3 insertions, 3 deletions
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" diff --git a/templates/interfaces/loopback/node.tag/description/node.def b/templates/interfaces/loopback/node.tag/description/node.def index d7becd1..ccec5e1 100644 --- a/templates/interfaces/loopback/node.tag/description/node.def +++ b/templates/interfaces/loopback/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" |