mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 05:04:21 +01:00
duckdns: clean up lock file at start also if no live cert exists (#1422)
Closes https://github.com/home-assistant/hassio-addons/issues/1337
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user