recipe_gentoo/recipes/recipe_check_ip_admin.sh

38 lines
978 B
Bash
Raw Normal View History

2019-03-24 15:56:17 +01:00
echo "-------------------------------------------------"
echo -e "--------------- ${BLUE}CHECK IP ADMIN${NC} ------------------"
echo -e "-------------------------------------------------\n"
# 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