remove temp file, enable logs
This commit is contained in:
parent
55c7082cc0
commit
bdbb589c25
10
get-certs.sh
10
get-certs.sh
@ -90,7 +90,7 @@ if [ ! -e "$HOME/.acme.sh/acme.sh" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# define acme.sh command
|
# define acme.sh command
|
||||||
acme_cmd="$HOME/.acme.sh/acme.sh"
|
acme_cmd="$HOME/.acme.sh/acme.sh --log"
|
||||||
if [ "$proxychains" = true ] ; then
|
if [ "$proxychains" = true ] ; then
|
||||||
if _exists proxychains ; then
|
if _exists proxychains ; then
|
||||||
acme_cmd="proxychains -q $acme_cmd"
|
acme_cmd="proxychains -q $acme_cmd"
|
||||||
@ -111,7 +111,7 @@ timestamp=`date +"%Y%m%d%H%M%S"`
|
|||||||
long_flag="--yes-I-know-dns-manual-mode-enough-go-ahead-please"
|
long_flag="--yes-I-know-dns-manual-mode-enough-go-ahead-please"
|
||||||
challenge_file=$twd/acme_challenge.$timestamp.txt
|
challenge_file=$twd/acme_challenge.$timestamp.txt
|
||||||
$acme_cmd --issue \
|
$acme_cmd --issue \
|
||||||
-d $domain \
|
-d "$domain" \
|
||||||
--dns $long_flag \
|
--dns $long_flag \
|
||||||
> $challenge_file
|
> $challenge_file
|
||||||
cat $challenge_file
|
cat $challenge_file
|
||||||
@ -124,7 +124,7 @@ echo TXT value is $txt_value
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# launch dnsmasq
|
# launch dnsmasq
|
||||||
touch /tmp/dnsm.tmp.cnf \
|
touch $twd/dnsm.tmp.cnf \
|
||||||
&& dnsmasq \
|
&& dnsmasq \
|
||||||
--conf-file=/tmp/dnsm.tmp.cnf \
|
--conf-file=/tmp/dnsm.tmp.cnf \
|
||||||
-k -d -D -b -R -n -h -q \
|
-k -d -D -b -R -n -h -q \
|
||||||
@ -137,12 +137,14 @@ sleep 5
|
|||||||
|
|
||||||
# issue certificate
|
# issue certificate
|
||||||
$acme_cmd --renew \
|
$acme_cmd --renew \
|
||||||
-d $domain \
|
-d "$domain" \
|
||||||
--dns $long_flag
|
--dns $long_flag
|
||||||
|
|
||||||
# kill dnsmasq
|
# kill dnsmasq
|
||||||
kill $dnsmasq_pid
|
kill $dnsmasq_pid
|
||||||
|
|
||||||
|
rm $twd/dnsm.tmp.cnf
|
||||||
|
|
||||||
echo "Job finished."
|
echo "Job finished."
|
||||||
echo "Remember to create a cron job to run this script once a month."
|
echo "Remember to create a cron job to run this script once a month."
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user