Created
July 25, 2022 00:55
-
-
Save sobujbd/0826cf67c56ef82bd354fe6dd91484b6 to your computer and use it in GitHub Desktop.
Run joohoi ACME DNS with Docker using different HTTP port.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | |
export PATH | |
start_acme_dns() | |
{ | |
sudo docker run --rm --name acmedns -p 53:53 -p 53:53/udp -p 8443:80 -v /path/to/your/acme-dns/config:/etc/acme-dns:ro -v /path/to/your/acme-dns/data:/var/lib/acme-dns -d joohoi/acme-dns | |
} | |
stop_acme_dns() | |
{ | |
RESULT=`docker ps | grep 'joohoi/acme-dns' | awk '{ print $1 }'` | |
if [[ $RESULT == "" ]]; | |
then | |
echo -e "$(date --iso=s -u) [WARN] acme dns not running!" 1>&2; | |
else | |
echo "$(date --iso=s -u) [INFO] acme dns is running (CID: $RESULT)." | |
echo "$(date --iso=s -u) [INFO] stopping now..." | |
sudo docker stop $RESULT | |
fi | |
} | |
status_acme_dns() | |
{ | |
RESULT=`docker ps | grep 'joohoi/acme-dns' | awk '{ print $1 }'` | |
if [[ $RESULT == "" ]]; | |
then | |
echo -e "$(date --iso=s -u) [WARN] acme dns not running!" 1>&2; | |
else | |
echo "$(date --iso=s -u) [INFO] acme dns is running (CID: $RESULT)." | |
fi | |
} | |
action=$1 | |
if [ "${1}" == 'start' ];then | |
start_acme_dns | |
elif [ "${1}" == 'stop' ];then | |
stop_acme_dns | |
elif [ "${1}" == 'status' ];then | |
status_acme_dns | |
else | |
echo "Usage acmedns start|stop|status" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also you may need to enable
ufw
and allow the desired port.