Commit 2b1ef5b0 authored by Daniel P. Berrangé's avatar Daniel P. Berrangé

scripts: portability fixes in checking command output

Some versions of libvirt/dnsmasq will spawn a child process, so we must
trim output from ps to only show the first (main) process.

With IPv6 networking we might also get a link local address, which we
should skip because it will be different each time, derived from the
random MAC address.
Reviewed-by: 's avatarLaine Stump <laine@laine.org>
Signed-off-by: 's avatarDaniel P. Berrangé <berrange@redhat.com>
parent 5d04fb4b
......@@ -9,7 +9,7 @@ ACCEPT all -- 0.0.0.0/0 10.1.2.0/24 state RELATED,ESTAB
ACCEPT all -- 10.1.2.0/24 0.0.0.0/0
#ip -o route show dev tck-testbr | gawk '{print $1" "$7}'
10.1.2.0/24 10.1.2.1
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.conf\).*|\1|p'
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.conf\).*|\1|p' | head -1
/dnsmasq/tck-testnet.conf
#grep bind-dynamic `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ s|.*--conf-file=\(.*tck-testnet.conf\).*|\1|p'`
bind-dynamic
......
......@@ -4,7 +4,7 @@ ACCEPT all -- 10.1.2.0/24 0.0.0.0/0
#iptables -t nat -L -n | grep ' 10\.1\.2\.'
#ip -o route show dev tck-testbr | gawk '{print $1" "$7}'
10.1.2.0/24 10.1.2.1
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.conf\).*|\1|p'
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.conf\).*|\1|p' | head -1
/dnsmasq/tck-testnet.conf
#grep bind-dynamic `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ s|.*--conf-file=\(.*tck-testnet.conf\).*|\1|p'`
bind-dynamic
......
......@@ -12,7 +12,7 @@ ACCEPT all ::/0 2001:db8:ac10:fd01::/64
ACCEPT all 2001:db8:ac10:fd01::/64 ::/0
ACCEPT all ::/0 2001:db8:ac10:fe01::/64
ACCEPT all 2001:db8:ac10:fe01::/64 ::/0
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.conf\).*|\1|p'
#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.conf\).*|\1|p' | head -1
/dnsmasq/tck-testnet.conf
#grep bind-dynamic `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ s|.*--conf-file=\(.*tck-testnet.conf\).*|\1|p'`
bind-dynamic
......@@ -22,7 +22,7 @@ dhcp-range=2001:db8:ac10:fe01::1,ra-only
dhcp-range=2001:db8:ac10:fd01::1,ra-only
#brctl show | grep tck-testbr | gawk '{print $1" "$3}'
tck-testbr yes
#ip -o addr show dev tck-testbr | gawk '{print $4" "$6}'
#ip -o addr show dev tck-testbr | gawk '{print $4" "$6}' | grep -v link
10.1.2.1/24 10.1.2.255
192.168.123.1/24 192.168.123.255
172.28.255.241/28 172.28.255.255
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment