mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 03:15:49 +00:00
fix: Backup folder generation
This commit is contained in:
parent
adc4eda4f2
commit
e3e3a45697
1 changed files with 4 additions and 3 deletions
|
|
@ -9,7 +9,7 @@ backup () {
|
||||||
|
|
||||||
local count=1
|
local count=1
|
||||||
local iso="$1"
|
local iso="$1"
|
||||||
local folder="unknown"
|
local name="unknown"
|
||||||
local root="$STORAGE/backups"
|
local root="$STORAGE/backups"
|
||||||
local previous="$STORAGE/windows.base"
|
local previous="$STORAGE/windows.base"
|
||||||
|
|
||||||
|
|
@ -18,17 +18,18 @@ backup () {
|
||||||
previous=$(<"$previous")
|
previous=$(<"$previous")
|
||||||
previous="${previous//[![:print:]]/}"
|
previous="${previous//[![:print:]]/}"
|
||||||
|
|
||||||
[ -n "$previous" ] && folder="${previous%.*}"
|
[ -n "$previous" ] && name="${previous%.*}"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$root"
|
mkdir -p "$root"
|
||||||
|
local folder="$name"
|
||||||
local dir="$root/$folder"
|
local dir="$root/$folder"
|
||||||
|
|
||||||
while [ -d "$dir" ]
|
while [ -d "$dir" ]
|
||||||
do
|
do
|
||||||
count=$[$count +1]
|
count=$[$count +1]
|
||||||
folder="${folder%.*}.${count}"
|
folder="${name}.${count}"
|
||||||
dir="$root/$folder"
|
dir="$root/$folder"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue