From: Andreas Loibl Date: Tue, 17 Oct 2017 14:39:46 +0000 (+0200) Subject: fix account command X-Git-Tag: v0.5.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F446%2Fhead;p=thirdparty%2Fdehydrated.git fix account command backup file path generation should split the filename on the last dot instead of the first --- diff --git a/dehydrated b/dehydrated index 5923687..1f364df 100755 --- a/dehydrated +++ b/dehydrated @@ -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}"