projects
/
sysadmin-cookbook
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3bfedc
)
use only first ip address
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 25 Jan 2011 14:40:42 +0000
(14:40 +0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 25 Jan 2011 14:40:42 +0000
(14:40 +0000)
git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@235
191e9f34
-6774-4a6d-acfc-
7664dacd4a2a
recepies/lxc/lxc-watchdog.sh
patch
|
blob
|
history
diff --git
a/recepies/lxc/lxc-watchdog.sh
b/recepies/lxc/lxc-watchdog.sh
index
11fe0ac
..
da013d8
100755
(executable)
--- a/
recepies/lxc/lxc-watchdog.sh
+++ b/
recepies/lxc/lxc-watchdog.sh
@@
-47,8
+47,9
@@
lxc_hostname() {
}
lxc_ip() {
- ( grep lxc.network.ipv4 /var/lib/lxc/$name/config | cut -d= -f2 || \
- grep address $(lxc_rootfs $name)/etc/network/interfaces | sed 's/.*address //' ) | \
+ ( grep lxc.network.ipv4 /var/lib/lxc/$name/config | grep -v '^#' | cut -d= -f2 || \
+ grep address $(lxc_rootfs $name)/etc/network/interfaces | grep -v '^#' | sed 's/.*address //' ) | \
+ head -1 | \
sed -e 's/ *//g' -e 's/\/.*$//'
}