remove non numeric characters from snapshot id (#76)

Snapper support enhanced
This commit is contained in:
Hrotkó Gábor
2019-12-07 14:14:11 +01:00
committed by Antynea
parent cb0b55a6bb
commit 4a882e77dc

View File

@@ -300,6 +300,10 @@ snapshot_list()
local entry="${entries[$i]}"
for j in "${!snapper_ids[@]}"; do
local snapper_id="${snapper_ids[$j]//[[:space:]]/}"
# remove other non numeric characters
snapper_id="${snapper_id//\*/}"
snapper_id="${snapper_id//\+/}"
snapper_id="${snapper_id//-/}"
if [[ "$snapper_id" == "$id" ]]; then
local snapper_type=$(trim "${snapper_types[$j]}")
local snapper_description=$(trim "${snapper_descriptions[$j]}")