diff --git a/lib/general b/lib/general index ae6def0..0b7c0af 100644 --- a/lib/general +++ b/lib/general @@ -122,7 +122,7 @@ pre_install() { api-events_update i1 sudo apt-get -y -qq install dialog sudo apt-get -y -qq install software-properties-common - sudo apt-get -y -qq install python-software-properties + [[ $(check_osname) != "bionic" ]] && sudo apt-get -y -qq install python-software-properties sudo apt-get -y -qq install pwgen sudo apt-get -y -qq install unzip sudo apt-get -y -qq install zip diff --git a/lib/site-ssl b/lib/site-ssl index 8d74120..2da116d 100644 --- a/lib/site-ssl +++ b/lib/site-ssl @@ -80,6 +80,9 @@ site_ssl_on() { # Single cert elif [[ ! -a /etc/letsencrypt/live/$domain/fullchain.pem ]]; then sudo certbot certonly --webroot -w /var/www/$root/htdocs/ $domset $param + + elif [[ -a /etc/letsencrypt/live/$domain/fullchain.pem ]]; then + echo "${blu}Certificate for $domain already exist and found, wait while we configure your server to use it!${end}" fi diff --git a/plugins/site b/plugins/site index 867c782..ffd2dfe 100644 --- a/plugins/site +++ b/plugins/site @@ -23,12 +23,6 @@ if [[ ! $(conf_read nginx) == "true" ]]; then exit 1 fi -# Check if user entered arg before option and correct it. -if [[ -n $cache && ($type == "-cache" || $type == "-root" || $type == "-root-path" || $type == "-subdomain" || $type == "-ignore-ssl" || $type == "-wildcard") ]]; then - type=${3,,} - cache=${2,,} -fi - # Extract value if exist if [[ $domain == "-mysql="* ]]; then @@ -44,6 +38,12 @@ if [[ $cache == "-root="* || $cache == "-subdomain="* || $cache == "-root-path= cache=$(echo "${cache}" | cut -d'=' -f 1 -s) fi +# Check if user entered arg before option and correct it. +if [[ -n $cache && ($type == "-cache" || $type == "-root" || $type == "-root-path" || $type == "-subdomain" || $type == "-ignore-ssl" || $type == "-wildcard") ]]; then + type=${3,,} + cache=${2,,} +fi + # Check if site is sub-domain if [[ -n $domain && $type =~ ^(-html|-php|-mysql|-wp|-wpsubdir|-wpsubdom|-parked|-proxy|-ssl-on|-force-redirect)$ ]]; then diff --git a/plugins/webinoly b/plugins/webinoly index ae739da..0bede88 100644 --- a/plugins/webinoly +++ b/plugins/webinoly @@ -232,7 +232,7 @@ elif [[ $opt == "-uninstall" ]]; then swap_delete fi if [[ $(conf_read pre-packs) == true ]]; then - sudo apt-get -y -qq purge pwgen unzip > /dev/null + sudo apt-get -y -qq purge pwgen unzip zip > /dev/null sudo apt-get -y -qq autoremove > /dev/null conf_write pre-packs purged fi @@ -298,21 +298,21 @@ elif [[ $opt == "-clear-cache" ]]; then exit 1 fi if [[ $value == "redis" || $value == "all" ]]; then - if [[ $(conf_read php-tool) == "true" ]]; then + if [[ $(conf_read php-tool) == "true" && -a /etc/redis/redis.conf ]]; then sudo redis-cli flushall echo "${gre}- Redis Cache has been successfully cleared!${end}" else - echo "${red}[ERROR] We can not clear Redis Cache because PHP is not installed!${end}" + echo "${red}[ERROR] We can not clear Redis Cache because is not installed!${end}" fi fi if [[ $value == "memcache" || $value == "memcached" || $value == "all" ]]; then - if [[ $(conf_read php-tool) == "true" ]]; then + if [[ $(conf_read php-tool) == "true" && -a /etc/memcached.conf ]]; then memhost=$(grep ^-l /etc/memcached.conf | cut -f 2 -d ' ') memport=$(grep ^-p /etc/memcached.conf | cut -f 2 -d ' ') echo flush_all > /dev/tcp/$memhost/$memport echo "${gre}- Memcached has been successfully cleared!${end}" else - echo "${red}[ERROR] We can not clear Memcache because PHP is not installed!${end}" + echo "${red}[ERROR] We can not clear Memcache because is not installed!${end}" fi fi if [[ $value == "opcache" || $value == "all" ]]; then @@ -355,10 +355,12 @@ elif [[ $opt == "-timezone" ]]; then elif [[ $opt == "-version" || $opt == "-v" || $opt == "-V" ]]; then + [[ -z $(conf_read server-version) ]] && sver="Not installed!" || sver=$(conf_read server-version) + echo "${blu}" echo "Webinoly version: $(app_version)" - echo "Current stack version: $(conf_read server-version)" - echo "Available stack version: $(svr_version)" + echo "Current stack version: $sver" + [[ $sver != $(svr_version) ]] && echo "Available stack version: $(svr_version)" echo "${end}"