diff --git a/lib/general b/lib/general index c80a244..2c2be14 100644 --- a/lib/general +++ b/lib/general @@ -57,10 +57,10 @@ db_delete() { fi else if [[ $dbdatadel == "true" ]]; then - local dbdatauser=$(echo "${dbdata}" | cut -d',' -f 3 -s) - local dbdatapass=$(echo "${dbdata}" | cut -d',' -f 4 -s) + local uroot=$(echo "${dbdata}" | cut -d',' -f 3 -s) + local proot=$(echo "${dbdata}" | cut -d',' -f 4 -s) fi - if [[ -z $dbdatauser || -z $dbdatapass ]]; then + if [[ -z $uroot || -z $proot ]]; then echo "" echo "${gre}External DB found in $domain (Press 'Enter' key twice to skip and not delete)" read -p "${blu}External DB root username [root]: " uroot @@ -68,7 +68,7 @@ db_delete() { read -p "External DB root password: " proot fi if [[ $uroot == "root" && -z $proot ]]; then - echo "${red} Action aborted, database not deteted!" + echo "${red} Action aborted, database not deleted!" continue 1; else sudo mysql --connect-timeout=10 -h "$url" -P "$port" -u"$uroot" -p"$proot" -e "$dbsetup" diff --git a/plugins/httpauth b/plugins/httpauth index 32ddc6a..68dd046 100644 --- a/plugins/httpauth +++ b/plugins/httpauth @@ -52,7 +52,7 @@ elif [[ $opt == "-delete" ]]; then echo "${red}User '$userpurge' does not exist!${end}" exit 1 fi - sudo sed -i "/$userpurge/d" /etc/nginx/.htpasswd + sudo sed -i "/^$userpurge:/d" /etc/nginx/.htpasswd echo "${gre}User '$userpurge has been deleted successfully!${end}" elif [[ $opt == "-list" ]]; then [[ ! -a /etc/nginx/.htpasswd ]] && exit 0 diff --git a/plugins/site b/plugins/site index 67a5ede..065a378 100644 --- a/plugins/site +++ b/plugins/site @@ -46,7 +46,7 @@ fi # Check if site is sub-domain -if [[ -n $domain && $type =~ ^(-html|-php|-mysql|-wp|-wpsubdir|-wpsubdom|-parked|-proxy)$ ]]; then +if [[ -n $domain && $type =~ ^(-html|-php|-mysql|-wp|-wpsubdir|-wpsubdom|-parked|-proxy|-ssl-on)$ ]]; then count=1 while true; do tld=$(echo "${domain}" | rev | cut -d'.' -f -$count -s | rev) @@ -77,7 +77,16 @@ if [[ $type == "-wp" || $type == "-wpsubdir" || $type == "-wpsubdom" || $type == wpdata=${value:1:-1} # Because MySQL format not have this parameters at the beggining to match WP format. Insert it! - [[ $type == "-mysql" || $domain == "-mysql" ]] && wpdata=${wpdata/#/true,false,} + if [[ $type == "-mysql" || $domain == "-mysql" ]]; then + wpdata=${wpdata/#/true,false,} + # Insert wp_prefix if external db data is found. + extdata=$(echo "${wpdata,,}" | cut -d',' -f 7- -s) + if [[ -n $extdata ]]; then + wpdata=$(echo "${wpdata,,}" | cut -d',' -f -6 -s) + wpdata=${wpdata/%/,false,} + wpdata=${wpdata/%/$extdata} + fi + fi # Double coma is for lower case convertion setmsqcustom=$(echo "${wpdata,,}" | cut -d',' -f 1 -s) diff --git a/plugins/stack b/plugins/stack index 1f9e8ee..b877bc3 100644 --- a/plugins/stack +++ b/plugins/stack @@ -388,7 +388,7 @@ elif [[ $opt == "-pma" ]]; then [[ $(conf_read mysql-tool) != "true" ]] && mysql_tool || echo "${red}PhpMyAdmin is already installed!${end}" elif [[ $opt == "-lemp" ]]; then - stack -nginx $arg + [[ $value =~ ^(stable|mainline)$ ]] && stack -nginx=$value $arg || stack -nginx $arg stack -php $arg stack -mysql $arg echo "" diff --git a/weby b/weby index 155fe98..c706099 100644 --- a/weby +++ b/weby @@ -1,7 +1,7 @@ #!/bin/bash # Webinoly Installation Script. -webyversion="1.4.0-beta" +webyversion="1.4.0" # Check OS support @@ -77,7 +77,6 @@ if [[ -a /opt/webinoly/webinoly.conf && -n $(conf_read tools-port) ]]; then else portools="22222" [[ -n $2 && $2 != "-ver="* ]] && portools="$2" - echo $portools tools_port $portools fi