install-gns3-debian12/hv_get_dhcp_info.sh

13 lines
196 B
Bash
Raw Permalink Normal View History

#!/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