mirror of
https://github.com/dockur/windows.git
synced 2026-07-15 01:38:16 +01:00
feat: Use state helper for base image reads (#1839)
This commit is contained in:
+4
-15
@@ -11,17 +11,11 @@ backup () {
|
||||
local iso="$1"
|
||||
local name="unknown"
|
||||
local root="$STORAGE/backups"
|
||||
local previous="$STORAGE/windows.base"
|
||||
|
||||
if [ -f "$previous" ]; then
|
||||
|
||||
previous=$(<"$previous")
|
||||
previous="${previous//[![:print:]]/}"
|
||||
local previous
|
||||
|
||||
previous=$(readState "base") || return 1
|
||||
[ -n "$previous" ] && name="${previous%.*}"
|
||||
|
||||
fi
|
||||
|
||||
if ! makeDir "$root"; then
|
||||
error "Failed to create directory \"$root\" !"
|
||||
return 1
|
||||
@@ -59,12 +53,9 @@ skipInstall() {
|
||||
local method=""
|
||||
local magic byte
|
||||
local boot="$STORAGE/windows.boot"
|
||||
local previous="$STORAGE/windows.base"
|
||||
local previous
|
||||
|
||||
if [ -f "$previous" ]; then
|
||||
|
||||
previous=$(<"$previous")
|
||||
previous="${previous//[![:print:]]/}"
|
||||
previous=$(readState "base") || return 1
|
||||
|
||||
if [ -n "$previous" ]; then
|
||||
if [[ "${STORAGE,,}/${previous,,}" != "${iso,,}" ]]; then
|
||||
@@ -100,8 +91,6 @@ skipInstall() {
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
[ -f "$boot" ] && hasDisk && return 0
|
||||
|
||||
[ ! -f "$iso" ] && return 1
|
||||
|
||||
Reference in New Issue
Block a user