]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
fix account command 446/head
authorAndreas Loibl <a.loibl@traviangames.com>
Tue, 17 Oct 2017 14:39:46 +0000 (16:39 +0200)
committerAndreas Loibl <a.loibl@traviangames.com>
Tue, 17 Oct 2017 14:39:46 +0000 (16:39 +0200)
backup file path generation should split the filename on the last dot instead of the first

dehydrated

index 5923687ff73037d919340b43063c8deba0af1b43..1f364df7daab48c2c7898e851274e2a37d4561f6 100755 (executable)
@@ -903,7 +903,7 @@ command_account() {
     echo "+ Account information was the same after the update"
     rm "${NEW_ACCOUNT_KEY_JSON}"
   else
-    ACCOUNT_KEY_JSON_BACKUP="$(echo "${ACCOUNT_KEY_JSON}" | cut -d. -f1)-$(date +%s).json"
+    ACCOUNT_KEY_JSON_BACKUP="${ACCOUNT_KEY_JSON%.*}-$(date +%s).json"
     echo "+ Backup ${ACCOUNT_KEY_JSON} as ${ACCOUNT_KEY_JSON_BACKUP}"
     cp -p "${ACCOUNT_KEY_JSON}" "${ACCOUNT_KEY_JSON_BACKUP}"
     echo "+ Populate ${ACCOUNT_KEY_JSON}"