ACME: Fix missing quotes in variable comparisons
authorToke Høiland-Jørgensen <redacted>
Fri, 22 Mar 2019 12:45:11 +0000 (13:45 +0100)
committerToke Høiland-Jørgensen <redacted>
Fri, 22 Mar 2019 12:45:11 +0000 (13:45 +0100)
The variables can be empty if not set in the UCI config.

Reported-by: Petr Novák <redacted>
Signed-off-by: Toke Høiland-Jørgensen <redacted>
net/acme/Makefile
net/acme/files/run.sh

index 69dd3441f1f223ddc738feeaf77c947c763ecb83..1c2f5fb1d07615fba660e423fe06d28003164bcc 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acme
 PKG_VERSION:=2.7.9
-PKG_RELEASE:=7
+PKG_RELEASE:=8
 PKG_LICENSE:=GPLv3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
index b0cae8fa6493b92440a583b6ea65ee7b148ca2c3..b7a6f1899bfca6a1a2c5dff36b4b08e7cc3b12dc 100644 (file)
@@ -129,7 +129,7 @@ post_checks()
     iptables -D input_rule -p tcp --dport 80 -j ACCEPT -m comment --comment "ACME" 2>/dev/null
     ip6tables -D input_rule -p tcp --dport 80 -j ACCEPT -m comment --comment "ACME" 2>/dev/null
 
-    if [ -e /etc/init.d/uhttpd ] && ( [ -n "$UHTTPD_LISTEN_HTTP" ] || [ $UPDATE_UHTTPD -eq 1 ] ); then
+    if [ -e /etc/init.d/uhttpd ] && ( [ -n "$UHTTPD_LISTEN_HTTP" ] || [ "$UPDATE_UHTTPD" -eq 1 ] ); then
         if [ -n "$UHTTPD_LISTEN_HTTP" ]; then
             uci set uhttpd.main.listen_http="$UHTTPD_LISTEN_HTTP"
             UHTTPD_LISTEN_HTTP=
@@ -138,7 +138,7 @@ post_checks()
         /etc/init.d/uhttpd reload
     fi
 
-    if [ -e /etc/init.d/nginx ] && ( [ "$NGINX_WEBSERVER" -eq 1 ] || [ $UPDATE_NGINX -eq 1 ] ); then
+    if [ -e /etc/init.d/nginx ] && ( [ "$NGINX_WEBSERVER" -eq 1 ] || [ "$UPDATE_NGINX" -eq 1 ] ); then
         NGINX_WEBSERVER=0
         /etc/init.d/nginx restart
     fi
@@ -204,7 +204,7 @@ issue_cert()
     [ -n "$webroot" ] || [ -n "$dns" ] || pre_checks "$main_domain" || return 1
 
     log "Running ACME for $main_domain"
-    
+
     handle_credentials() {
         local credential="$1"
         eval export $credential
git clone https://git.99rst.org/PROJECT