Added hyperv kvp guest services debian scripts

This commit is contained in:
root 2024-07-15 22:50:23 +03:00
parent e7a63c9f7e
commit e1eeda711c
3 changed files with 21 additions and 0 deletions

View File

@ -116,3 +116,9 @@ install-default-iptables-persistent-rules:
cp -vf rules.v4 /etc/iptables/rules.v4 cp -vf rules.v4 /etc/iptables/rules.v4
cp -vf rules.v6 /etc/iptables/rules.v6 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

12
hv_get_dhcp_info.sh Executable file
View File

@ -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

3
hv_get_dns_info.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
cat /etc/resolv.conf 2>/dev/null | awk '/^nameserver/ { print $2 }'