]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
cleanup: also remove dangling symlinks
authorLukas Schauer <lukas@schauer.so>
Thu, 10 Dec 2020 13:15:07 +0000 (14:15 +0100)
committerLukas Schauer <lukas@schauer.so>
Thu, 10 Dec 2020 13:15:07 +0000 (14:15 +0100)
dehydrated

index 8d277a3430ad76ebe8d0b6239fc7bcd65dbd33e0..03c1d9f2219cc0a82ba2069e025496ab811afc09 100755 (executable)
@@ -1884,6 +1884,10 @@ command_cleanup() {
         # Look up current file in use
         current="$(basename "$(readlink "${certdir}/${filetype}")")"
       else
+        if [[ -h "${certdir}/${filetype}" ]]; then
+          echo "Removing broken symlink: ${certdir}/${filetype}"
+          rm -f "${certdir}/${filetype}"
+        fi
         current=""
       fi