Skip to content

Commit

Permalink
duckdns: clean up lock file at start also if no live cert exists (hom…
Browse files Browse the repository at this point in the history
  • Loading branch information
scop authored Jun 25, 2020
1 parent b87ad0d commit c1f3137
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions duckdns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.12.1

- Clean up dehydrated lock file at start also if no live cert exists

## 1.12.0

- Add option to specify a service or URL as IPv4 and IPv6 address source
Expand Down
2 changes: 1 addition & 1 deletion duckdns/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Duck DNS",
"version": "1.12.0",
"version": "1.12.1",
"slug": "duckdns",
"description": "Free Dynamic DNS (DynDNS or DDNS) service with Let's Encrypt support",
"url": "https://github.com/home-assistant/hassio-addons/tree/master/duckdns",
Expand Down
14 changes: 8 additions & 6 deletions duckdns/data/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@ if bashio::config.true 'lets_encrypt.accept_terms'; then
# Init folder structs
mkdir -p "${CERT_DIR}"
mkdir -p "${WORK_DIR}"


# Clean up possible stale lock file
if [ -e "${WORK_DIR}/lock" ]; then
rm -f "${WORK_DIR}/lock"
bashio::log.warning "Reset dehydrated lock file"
fi

# Generate new certs
if [ ! -d "${CERT_DIR}/live" ]; then
# Create empty dehydrated config file so that this dir will be used for storage
touch "${WORK_DIR}/config"

dehydrated --register --accept-terms --config "${WORK_DIR}/config"
elif [ -e "${WORK_DIR}/lock" ]; then
# Some user reports issue with lock files/cleanup
rm -rf "${WORK_DIR}/lock"
bashio::log.warning "Reset dehydrated lock file"
fi
fi

Expand Down

0 comments on commit c1f3137

Please sign in to comment.