From 020edd51be3d9e06812a6377b1131c7a300ddac5 Mon Sep 17 00:00:00 2001 From: Maksytka Date: Thu, 27 Nov 2025 07:26:44 +0700 Subject: [PATCH] Add bash ip-fetching of VMs script to virsh/ip-fetching --- bash/ip_fetch/mk_ip-hostname_table.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 bash/ip_fetch/mk_ip-hostname_table.sh diff --git a/bash/ip_fetch/mk_ip-hostname_table.sh b/bash/ip_fetch/mk_ip-hostname_table.sh new file mode 100755 index 0000000..82f3d05 --- /dev/null +++ b/bash/ip_fetch/mk_ip-hostname_table.sh @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +prefix="hosting_" +postfix="_vm" + +for var in $(cat ../../memlist) +do + echo $var:$(virsh domifaddr $prefix$var$postfix --full --source arp | awk '/192.168.0./ {print $4}' | cut -d "/" -f 1) +done