diff --git a/Makefile b/Makefile index 01e4a10..e6ecafd 100644 --- a/Makefile +++ b/Makefile @@ -116,3 +116,9 @@ install-default-iptables-persistent-rules: cp -vf rules.v4 /etc/iptables/rules.v4 cp -vf rules.v6 /etc/iptables/rules.v6 +install-debain-hv-scripts: + mkdir -p /usr/libexec/hypervkvpd + cp -vf hv_get_dns_info.sh /usr/libexec/hypervkvpd/hv_get_dns_info + chmod +x /usr/libexec/hypervkvpd/hv_get_dns_info + cp -vf hv_get_dhcp_info.sh /usr/libexec/hypervkvpd/hv_get_dhcp_info + chmod +x /usr/libexec/hypervkvpd/hv_get_dhcp_info diff --git a/hv_get_dhcp_info.sh b/hv_get_dhcp_info.sh new file mode 100755 index 0000000..422602f --- /dev/null +++ b/hv_get_dhcp_info.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +INTERFACE_NAME="$1" + +dhcp=$(grep "iface ${INTERFACE_NAME} inet dhcp" /etc/network/interfaces 2>/dev/null) + +if [ "$dhcp" != "" ]; +then + echo "Enabled" +else + echo "Disabled" +fi diff --git a/hv_get_dns_info.sh b/hv_get_dns_info.sh new file mode 100755 index 0000000..4e2b7f7 --- /dev/null +++ b/hv_get_dns_info.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cat /etc/resolv.conf 2>/dev/null | awk '/^nameserver/ { print $2 }'