2022-07-22 07:38:03 +00:00
#!/bin/bash
export TERM=linux
BGRN='\033[1;92m'
BGRY='\033[1;30m'
BBLU='\033[1;34m'
BRED='\033[1;91m'
BWHI='\033[1;97m'
2022-07-26 08:08:35 +00:00
CBLA='\033[?16;0;30c' # Hide blinking cursor
DFLT='\033[0m' # Reset colour
LCLR='\033[K' # Clear to end of line
PRST='\033[0;0H' # Reset cursor position
2022-07-22 07:38:03 +00:00
2022-08-23 10:37:38 +00:00
# COMPONENTS=('ca' 'ingress' 'storage' 'registry' 'git' 'gitops')
2023-01-22 14:08:12 +00:00
COMPONENTS=('storage' 'registry' 'git' 'gitops')
FQDN='{{ _template.metacluster.fqdn }}'
IPADDRESS='{{ _template.metacluster.vip }}'
2022-07-22 07:38:03 +00:00
2023-01-25 09:28:28 +00:00
I=0
2022-07-22 07:38:03 +00:00
while /bin/true; do
2023-01-13 08:03:35 +00:00
if [[ $I -gt 59 ]]; then
2023-01-07 10:58:58 +00:00
clear > /dev/tty1
I=0
else
I=$(( $I + 1 ))
fi
2022-07-22 07:38:03 +00:00
echo -e "${PRST}" > /dev/tty1
echo -e "\n\n\t${DFLT}To manage this appliance, please connect to one of the following:${LCLR}\n" > /dev/tty1
2022-07-26 08:08:35 +00:00
for c in "${COMPONENTS[@]}"; do
STATUS=$(curl -ks "https://${c}.${FQDN}" -o /dev/null -w '%{http_code}')
2022-07-22 07:38:03 +00:00
if [[ "${STATUS}" -eq "200" ]]; then
2022-07-26 08:08:35 +00:00
echo -e "\t [${BGRN}+${DFLT}] ${BBLU}https://${c}.${FQDN}${DFLT}${LCLR}" > /dev/tty1
2022-07-22 07:38:03 +00:00
else
2022-07-26 08:08:35 +00:00
echo -e "\t [${BRED}-${DFLT}] ${BBLU}https://${c}.${FQDN}${DFLT}${LCLR}" > /dev/tty1
2022-07-22 07:38:03 +00:00
fi
done
2022-07-26 08:08:35 +00:00
echo -e "\n\t${BGRY}Note that your DNS zone ${DFLT}must have${BGRY} respective records defined,\n\teach pointing to: ${DFLT}${IPADDRESS}${LCLR}" > /dev/tty1
2022-07-22 07:38:03 +00:00
echo -e "${CBLA}" > /dev/tty1
sleep 1
done