diff --git a/install_roundcube.sh b/install_roundcube.sh index 395c529..6c418d2 100755 --- a/install_roundcube.sh +++ b/install_roundcube.sh @@ -191,8 +191,12 @@ MAIN_DOMAIN=${_tmp_string##*.} [[ -n "$ROUNDCUBE_TMPDIR" ]] || ROUNDCUBE_TMPDIR="$DEFAULT_ROUNDCUBE_TMPDIR" -[[ -n "$IPV4" ]] || fatal "IPv4 Address (IPV4) not present!" -[[ -n "$IPV6" ]] || fatal "IPv4 Address (IPV6) not present!" +if [[ -z "$IPV4" ]] && [[ -z "$IPV6" ]] ; then + fatal "Neither an IPv4 nor an IPv6 address are given.!" +else + [[ -n "$IPV4" ]] || warn "IPv4 Address not present!" + [[ -n "$IPV6" ]] || warn "IPv6 Address not present!" +fi [[ -n "$APACHE_DEBIAN_INSTALLATION" ]] || APACHE_DEBIAN_INSTALLATION=false [[ -n "$PHP_DEBIAN_INSTALLATION" ]] || PHP_DEBIAN_INSTALLATION=false @@ -1221,10 +1225,26 @@ fi echononl "\tCreate VHost Configuration '${WEBSITE_NAME}.conf'.." _failed=false -cat < ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file +_create_vhost_config=true +if [[ -n "$IPV6" ]] && [[ -n "$IPV4" ]] ; then + _vhost_ip_string_80="$IPV4:80 [$IPV6]:80" + _vhost_ip_string_443="$IPV4:443 [$IPV6]:443" +elif [[ -n "$IPV4" ]] ; then + _vhost_ip_string_80="$IPV4:80" + _vhost_ip_string_443="$IPV4:443" +elif [[ -n "$IPV6" ]] ; then + _vhost_ip_string_80=" [$IPV6]:80" + _vhost_ip_string_443=" [$IPV6]:443" +else + echo_failed + error "Neither an ipv4 nor an ipv6 address are given.!" + _create_vhost_config=false +fi +if $_create_vhost_config ; then + cat < ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file # -- $WEBSITE_NAME -- # - + ServerAdmin $WEBMASTER_EMAIL @@ -1240,7 +1260,7 @@ cat < ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file - + ServerAdmin $WEBMASTER_EMAIL