summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-03-23 11:06:02 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-03-23 11:06:02 -0700
commite23a6efaeeaf1e1d35b64ac819aed7ea096e5288 (patch)
tree34fd3bbddbff4279a1104e9d430d5f0a86343b1f
parent1aecbf16ddf51516299df5ba444a35b259180d64 (diff)
downloadvyatta-cfg-e23a6efaeeaf1e1d35b64ac819aed7ea096e5288.tar.gz
vyatta-cfg-e23a6efaeeaf1e1d35b64ac819aed7ea096e5288.zip
Store description in ifalias
Use new kernel field to store description.
-rw-r--r--templates/interfaces/ethernet/node.tag/description/node.def2
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def2
-rw-r--r--templates/interfaces/loopback/node.tag/description/node.def2
3 files changed, 6 insertions, 0 deletions
diff --git a/templates/interfaces/ethernet/node.tag/description/node.def b/templates/interfaces/ethernet/node.tag/description/node.def
index aeb40f0..7614037 100644
--- a/templates/interfaces/ethernet/node.tag/description/node.def
+++ b/templates/interfaces/ethernet/node.tag/description/node.def
@@ -1,2 +1,4 @@
type: txt
help: Set description for this interface
+create: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../@)/ifalias"
+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 aeb40f0..49a72af 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,2 +1,4 @@
type: txt
help: Set description for this interface
+create: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../../@).$VAR(../@)/ifalias"
+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 aeb40f0..7614037 100644
--- a/templates/interfaces/loopback/node.tag/description/node.def
+++ b/templates/interfaces/loopback/node.tag/description/node.def
@@ -1,2 +1,4 @@
type: txt
help: Set description for this interface
+create: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../@)/ifalias"
+delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias"