live-systems.org/gitweb
/
live-config.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b302f5
)
Adding support for variables (ip and mac addresses) in hostname script.
author
Daniel Baumann
<daniel@debian.org>
Fri, 4 Jan 2013 22:46:13 +0000
(23:46 +0100)
committer
Daniel Baumann
<daniel@debian.org>
Fri, 4 Jan 2013 22:47:00 +0000
(23:47 +0100)
scripts/config/0020-hostname
patch
|
blob
|
blame
|
history
diff --git
a/scripts/config/0020-hostname
b/scripts/config/0020-hostname
index
3872437
..
21c3e84
100755
(executable)
--- a/
scripts/config/0020-hostname
+++ b/
scripts/config/0020-hostname
@@
-10,6
+10,11
@@
Hostname ()
{
+ # Supporting variables within hostnames
+ LINK="$(ip -oneline -family link address show dev eth0 | awk '{ print $13 }' | sed -e 's|:|-|g')"
+ INET="$(ip -oneline -family inet address show dev eth0 | awk '{ print $4 }' | sed -e 's|\.|-|g' -e 's|/.*||')"
+ INET6="$(ip -oneline -family inet6 address show dev eth0 | awk '{ print $4 }' | sed -e 's|:|-|g' -e 's|/.*||' -e 's|--|-|')"
+
# Reading kernel command line
for _PARAMETER in ${_CMDLINE}
do