Skip to content

Commit

Permalink
some small fixes
Browse files Browse the repository at this point in the history
Fixed before release:
- stack lemp not acepting stable/mainline parameter.
- external db unattended not working.
- httpauth delete similar names issues.
- mysql site with external db not should need wp prefix parameter, removed!
- ssl-on failing due to subdomain check.
  • Loading branch information
QROkes committed Apr 5, 2018
1 parent a0a8981 commit 32d9986
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/general
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ 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
uroot=${uroot:-root}
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"
Expand Down
2 changes: 1 addition & 1 deletion plugins/httpauth
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions plugins/site
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion plugins/stack
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
3 changes: 1 addition & 2 deletions weby
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Webinoly Installation Script.
webyversion="1.4.0-beta"
webyversion="1.4.0"


# Check OS support
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 32d9986

Please sign in to comment.