let dnsmasq processes running after script execution

This commit is contained in:
cynic 2024-08-19 04:05:04 +00:00
parent 7d4c257bf4
commit 499874a4b1

View File

@ -151,8 +151,14 @@ else
exit 1 exit 1
fi fi
# prepare to launche dnsmasq
tmp_conf_file=$twd/dnsmasq.$USER.tmp.cnf tmp_conf_file=$twd/dnsmasq.$USER.tmp.cnf
# clean dnsmasq processes
for p in `ps | grep dnsmasq.*.tmp.cnf | grep -v grep | awk '{print $1}'` ; do
kill $p ;
done
# launch acme challenge dnsmasq process # launch acme challenge dnsmasq process
touch $tmp_conf_file \ touch $tmp_conf_file \
&& dnsmasq \ && dnsmasq \
@ -193,14 +199,12 @@ echo "Waiting for $wait_before_renew seconds."
sleep $wait_before_renew sleep $wait_before_renew
# issue certificate # issue certificate
export MAX_RETRY_TIMES=40
$acme_cmd --renew --server $tls_provider \ $acme_cmd --renew --server $tls_provider \
-d "$domain" \ -d "$domain" \
--dns $long_flag --dns $long_flag
acme_renew_state=$? acme_renew_state=$?
# kill acme challenge dnsmasq process
kill $acme_dnsmasq_pid
rm $tmp_conf_file rm $tmp_conf_file
echo "" echo ""