recipe_gentoo/recipes/recipe_check_ip_admin.sh

36 lines
823 B
Bash
Executable file

print_config_title 'CHECK IP ADMIN'
# Check if ADMIN IPs are configured
# IPv6
echo ${LOCALES_IP_WITHOUT_LOOPBACK} | grep -q "^${IPV6_ADMIN_NETWORK}\| ${IPV6_ADMIN_NETWORK}"
# Return Code
RC=$?
# IPv6 Admin not configured
if [ $RC -ne 0 ]
then
BOOL_ADMIN_IPV6_NOT_CONFIGURED=1
echo -e "${RED}IPv6 Admin NOT CONFIGURED : check KO${NC}\n"
# IPv6 Admin configured
else
echo -e "${GREEN}IPv6 Admin CONFIGURED : check OK${NC}\n"
fi
# IPv4
echo ${LOCALES_IP_WITHOUT_LOOPBACK} | grep -q "^${IPV4_ADMIN_NETWORK}\| ${IPV4_ADMIN_NETWORK}"
# Return Code
RC=$?
# IPv4 Admin not configured
if [ $RC -ne 0 ]
then
BOOL_ADMIN_IPV4_NOT_CONFIGURED=1
echo -e "${RED}IPv4 Admin NOT CONFIGURED : check KO${NC}\n"
# IPv4 Admin configured
else
echo -e "${GREEN}IPv4 Admin CONFIGURED : check OK${NC}\n"
fi