diff --git a/get-certs.sh b/get-certs.sh index ddfd789..200176e 100755 --- a/get-certs.sh +++ b/get-certs.sh @@ -151,8 +151,14 @@ else exit 1 fi +# prepare to launche dnsmasq 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 touch $tmp_conf_file \ && dnsmasq \ @@ -193,14 +199,12 @@ echo "Waiting for $wait_before_renew seconds." sleep $wait_before_renew # issue certificate +export MAX_RETRY_TIMES=40 $acme_cmd --renew --server $tls_provider \ -d "$domain" \ --dns $long_flag acme_renew_state=$? -# kill acme challenge dnsmasq process -kill $acme_dnsmasq_pid - rm $tmp_conf_file echo ""