lists fixed

Minor fixes.
This commit is contained in:
Cristhian Martínez Ochoa 2020-02-06 17:32:26 -07:00
parent 898f7d54f8
commit 9813d56027
4 changed files with 10 additions and 10 deletions

View file

@ -1,6 +1,6 @@
#!/bin/bash
readonly app_version="1.10.1"
readonly app_version="1.10.2"
readonly svr_version="1.4"
readonly os_ubuntu_supported=(xenial bionic)
readonly php_supported=(7.2 7.3 7.4)

View file

@ -1266,15 +1266,15 @@ list_sites() {
do
domi=$(echo $site | cut -f 5 -d "/")
if [[ $domi != "default" && $domi != $(conf_read tools-port) ]]; then
[[ -f /var/www/$domi ]] && sign="${gre} +" || sign="${blu} *${gre}"
[[ -d /var/www/$domi ]] && sign="${gre} +" || sign="${blu} *${gre}"
[[ ! -L /etc/nginx/sites-enabled/$domi ]] && sign="${red} -"
outlist="$sign $domi ${end}"
if [[ $list == "raw" || $raw =~ ^(all|parked|disabled|main|true)$ ]]; then
outlist="$domi"
[[ $raw == "parked" && -f /var/www/$domi ]] && outlist=""
[[ $raw == "parked" && -d /var/www/$domi ]] && outlist=""
[[ $raw == "disabled" && -L /etc/nginx/sites-enabled/$domi ]] && outlist=""
[[ $raw == "main" && ( ! -L /etc/nginx/sites-enabled/$domi || ! -f /var/www/$domi ) ]] && outlist=""
[[ $raw == "main" && ( ! -L /etc/nginx/sites-enabled/$domi || ! -d /var/www/$domi ) ]] && outlist=""
elif [[ -n $raw ]]; then
echo "${red}[ERROR] Please, enter a valid value for RAW!${end}"
exit 1

View file

@ -1089,11 +1089,11 @@ nginx_blockip() {
if [[ -z $purge ]]; then
if [[ -n $list ]]; then
echo ""
[[ -n $raw ]] && sign="" || sign="${blu}+ "
[[ $list == "raw" || -n $raw ]] && sign="" || sign="${blu}+ "
if [[ -s /etc/nginx/conf.d/blockips.conf ]]; then
sudo sed -n "s/^deny /${sign}/p;" /etc/nginx/conf.d/blockips.conf | sudo sed -n 's/;$//p'
else
echo "[Empty] No IP's were found!"
[[ $list != "raw" && -z $raw ]] && echo "[Empty] No IP's were found!"
fi
[[ $list == "raw" || -n $raw ]] && echo "" || echo "${end}"
else

View file

@ -146,15 +146,15 @@ elif [[ -n $whitelist ]]; then
api-events_update ha4
if [[ -z $purge ]]; then
if [[ -n $list ]]; then
[[ -n $raw ]] && echo "" || echo "${blu}"
[[ $list == "raw" || -n $raw ]] && echo "" || echo "${blu}"
if [[ -f /etc/nginx/apps.d/whitelist-acl.conf && -z $raw ]]; then
sudo sed -n 's/^allow //p;' /etc/nginx/apps.d/whitelist-acl.conf | sudo sed -n 's/;$//p' | sed 's/^/+ /'
elif [[ -f /etc/nginx/apps.d/whitelist-acl.conf && -n $raw ]]; then
sudo sed -n 's/^allow //p;' /etc/nginx/apps.d/whitelist-acl.conf | sudo sed -n 's/;$//p'
else
echo "[Empty] No IP's were found!"
[[ $list != "raw" && -z $raw ]] && echo "[Empty] No IP's were found!"
fi
[[ -n $raw ]] && echo "" || echo "${end}"
[[ $list == "raw" || -n $raw ]] && echo "" || echo "${end}"
else
[[ $whitelist == true ]] && read -p "${blu}IP address to whitelist: ${end}" whitelist
if [[ $(ip_check $whitelist) == "true" ]]; then
@ -294,7 +294,7 @@ elif [[ $list == "protected" && -n $domain ]]; then
elif [[ -f /etc/nginx/apps.d/$domain-nginx.conf && -n $raw ]]; then
sudo sed -n 's/^# Path: //p;' /etc/nginx/apps.d/$domain-nginx.conf
elif [[ -z $root ]]; then
echo "[Empty] No protected paths were found!"
[[ -z $raw ]] && echo "[Empty] No protected paths were found!"
fi
[[ -n $raw ]] && echo "" || echo "${end}"
nginx_not="true" # Nginx-Reload not-needed.