From 20bd14fe7bf04f1acba968f017b7a433c5f179e1 Mon Sep 17 00:00:00 2001 From: nachoparker Date: Sun, 17 Jan 2021 15:16:50 -0700 Subject: wizard: fix letsencrypt empty email Signed-off-by: nachoparker --- bin/ncp-diag | 12 +++++++----- bin/ncp/NETWORKING/letsencrypt.sh | 2 +- bin/ncp/NETWORKING/no-ip.sh | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/ncp-diag b/bin/ncp-diag index 4d2d0fc9..ef0d879c 100644 --- a/bin/ncp-diag +++ b/bin/ncp-diag @@ -64,11 +64,13 @@ echo "internet check|$( ping -W 2 -w 1 -q github.com &>/dev/null && echo ok || e function is_port_open() { - PORT=$1 - tmp_file=$(mktemp) - v=$(wget -T2 -t1 -q --keep-session-cookies --save-cookies $tmp_file https://portchecker.co -O - | grep -oP "_csrf\" value=\"\K.*\"") - wget -T2 -t1 -q --load-cookies $tmp_file https://portchecker.co --post-data "port=$PORT&_csrf=${v::-1}" -O - \ - | grep -q 'open' && { echo "open"; return 1; } + local PORT=$1 + local tmp_file=$(mktemp) + local v=$(wget -T2 -t1 -q --keep-session-cookies --save-cookies $tmp_file https://portchecker.co -O - | grep -oP "_csrf\" value=\"\K.*\"") + if [[ "$v" != "" ]]; then + wget -T2 -t1 -q --load-cookies $tmp_file https://portchecker.co --post-data "port=$PORT&_csrf=${v::-1}" -O - \ + | grep -q 'open' && { echo "open"; return 1; } + fi echo "closed" rm $tmp_file } diff --git a/bin/ncp/NETWORKING/letsencrypt.sh b/bin/ncp/NETWORKING/letsencrypt.sh index 449a5dc2..415567b0 100644 --- a/bin/ncp/NETWORKING/letsencrypt.sh +++ b/bin/ncp/NETWORKING/letsencrypt.sh @@ -62,7 +62,7 @@ configure() domain_string+=",${domain}" } done - $letsencrypt certonly -n --force-renew --no-self-upgrade --webroot -w $ncdir --hsts --agree-tos -m $EMAIL -d $domain_string && { + "${letsencrypt}" certonly -n --force-renew --no-self-upgrade --webroot -w "${ncdir}" --hsts --agree-tos -m "${EMAIL}" -d "${domain_string}" && { # Set up auto-renewal cat > /etc/cron.weekly/letsencrypt-ncp <> /etc/init.d/noip2 + cat debian.noip2.sh >> /etc/init.d/noip2 chmod +x /etc/init.d/noip2 cd - -- cgit v1.2.3