Skip to content

Commit

Permalink
Prevent missing ifalias from stopping config from committing, particu…
Browse files Browse the repository at this point in the history
…larly on boot
  • Loading branch information
neilalexander committed Dec 1, 2017
1 parent 9cb645e commit 98438fb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
type: txt
help: Description

priority: 999

syntax:expression: pattern $VAR(@) "^.{1,256}$" \
; "interface description is too long (limit 256 characters)"

update: sudo sh -c "echo \"$VAR(@)\" >/sys/class/net/$VAR(../@)/ifalias"
delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias"
update: sudo sh -c "if [ -f /sys/class/net/$VAR(../@)/ifalias ]; then echo \"$VAR(@)\" >/sys/class/net/$VAR(../@)/ifalias; fi"
delete: sudo sh -c "if [ -f /sys/class/net/$VAR(../@)/ifalias ]; then echo '' >/sys/class/net/$VAR(../@)/ifalias; fi"

0 comments on commit 98438fb

Please sign in to comment.