File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,21 @@ function print_hosts() {
1111 if [[ -n " $HOSTS " ]]; then
1212 print_info " Following hosts have been booted:"
1313 echo " $HOSTS " | while read -r line; do
14+ # skip, if line is empty
15+ [[ -z " $line " ]] && continue
16+
17+ # skip, if the line contains commented code
18+ [[ " $line " =~ ^[[:space:]]* # ]] && continue
19+
20+ # check for a list of domains
1421 [[ " $line " =~ VIRTUAL_HOST.[[:space:]]* (.* )$ ]]
22+ [[ -z " ${BASH_REMATCH[1]} " ]] && continue
1523
16- if [[ -n " $line " && -n " ${BASH_REMATCH[1]} " ]]; then
17- publish_single_entry_hosts_file " ${BASH_REMATCH[1]} "
24+ publish_single_entry_hosts_file " ${BASH_REMATCH[1]} "
1825
19- for addr in $( echo " ${BASH_REMATCH[1]} " | tr -d ' [:space:]' | tr " ," " \n" ) ; do
20- echo " https://$addr "
21- done
22- fi
26+ for addr in $( echo " ${BASH_REMATCH[1]} " | tr -d ' [:space:]' | tr " ," " \n" ) ; do
27+ echo " https://$addr "
28+ done
2329 done
2430 fi
2531}
You can’t perform that action at this time.
0 commit comments