configure.sh wizard, install improvements, encryption fixes, branch support #18
+27
-1
@@ -28,11 +28,37 @@ require_root() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_tools() {
|
check_tools() {
|
||||||
|
declare -A tool_pkg=(
|
||||||
|
[lsblk]="util-linux" [blkid]="util-linux"
|
||||||
|
[parted]="parted" [partprobe]="parted"
|
||||||
|
[mkfs.btrfs]="btrfs-progs" [git]="git"
|
||||||
|
[e2fsck]="e2fsprogs" [resize2fs]="e2fsprogs"
|
||||||
|
[tune2fs]="e2fsprogs"
|
||||||
|
)
|
||||||
local missing=()
|
local missing=()
|
||||||
for tool in lsblk blkid parted partprobe mkfs.btrfs git e2fsck resize2fs tune2fs; do
|
for tool in lsblk blkid parted partprobe mkfs.btrfs git e2fsck resize2fs tune2fs; do
|
||||||
command -v "$tool" >/dev/null 2>&1 || missing+=("$tool")
|
command -v "$tool" >/dev/null 2>&1 || missing+=("$tool")
|
||||||
done
|
done
|
||||||
[[ ${#missing[@]} -eq 0 ]] || die "Missing required tools: ${missing[*]}"
|
[[ ${#missing[@]} -eq 0 ]] && return 0
|
||||||
|
|
||||||
|
echo "Missing required tools: ${missing[*]}"
|
||||||
|
local pkgs=()
|
||||||
|
for tool in "${missing[@]}"; do
|
||||||
|
local pkg="${tool_pkg[$tool]}"
|
||||||
|
[[ " ${pkgs[*]} " != *" $pkg "* ]] && pkgs+=("$pkg")
|
||||||
|
done
|
||||||
|
|
||||||
|
read -r -p " Install missing packages (${pkgs[*]}) with dnf? [y/N]: " ans
|
||||||
|
if [[ "${ans,,}" == "y" ]]; then
|
||||||
|
dnf install -y "${pkgs[@]}" || die "Package installation failed."
|
||||||
|
local still_missing=()
|
||||||
|
for tool in "${missing[@]}"; do
|
||||||
|
command -v "$tool" >/dev/null 2>&1 || still_missing+=("$tool")
|
||||||
|
done
|
||||||
|
[[ ${#still_missing[@]} -eq 0 ]] || die "Still missing after install: ${still_missing[*]}"
|
||||||
|
else
|
||||||
|
die "Missing required tools: ${missing[*]}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Returns 0 if the remote install.sh matches this script's checksum,
|
# Returns 0 if the remote install.sh matches this script's checksum,
|
||||||
|
|||||||
Reference in New Issue
Block a user