diff options
| author | Craig Jennings <c@cjennings.net> | 2026-02-23 06:10:51 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-02-23 06:10:51 -0600 |
| commit | f667957b77eb5862248f41a89c68a4cbd7c633d9 (patch) | |
| tree | a9bf4c0438daa349a5b41b5af015242cc49ef7ea /custom | |
| parent | 4811ced2c222db1e80dbd3594f6e2bb50ed7218b (diff) | |
| download | archangel-f667957b77eb5862248f41a89c68a4cbd7c633d9.tar.gz archangel-f667957b77eb5862248f41a89c68a4cbd7c633d9.zip | |
fix: resolve remaining SC2155 warnings across all scripts
Declare and assign local variables separately in custom/archangel,
scripts/full-test.sh, scripts/test-install.sh, and remove unused
variable in custom/lib/zfs.sh.
Diffstat (limited to 'custom')
| -rwxr-xr-x | custom/archangel | 15 | ||||
| -rw-r--r-- | custom/lib/zfs.sh | 1 |
2 files changed, 10 insertions, 6 deletions
diff --git a/custom/archangel b/custom/archangel index 4150198..023115e 100755 --- a/custom/archangel +++ b/custom/archangel @@ -313,14 +313,16 @@ get_disks() { # Parse selected disks SELECTED_DISKS=() while IFS= read -r line; do - local disk=$(echo "$line" | awk '{print $1}') + local disk + disk=$(echo "$line" | awk '{print $1}') SELECTED_DISKS+=("$disk") done <<< "$selected" echo "" warn "Selected ${#SELECTED_DISKS[@]} disk(s):" for disk in "${SELECTED_DISKS[@]}"; do - local size=$(lsblk -d -n -o SIZE "$disk" | tr -d ' ') + local size + size=$(lsblk -d -n -o SIZE "$disk" | tr -d ' ') echo " - $disk ($size)" done echo "" @@ -349,7 +351,8 @@ get_raid_level() { local total_bytes=0 local smallest_bytes=0 for disk in "${SELECTED_DISKS[@]}"; do - local bytes=$(lsblk -b -d -n -o SIZE "$disk") + local bytes + bytes=$(lsblk -b -d -n -o SIZE "$disk") total_bytes=$((total_bytes + bytes)) if [[ $smallest_bytes -eq 0 ]] || [[ $bytes -lt $smallest_bytes ]]; then smallest_bytes=$bytes @@ -711,7 +714,8 @@ show_summary() { echo " Keymap: $KEYMAP" echo " Disks: ${#SELECTED_DISKS[@]} disk(s)" for disk in "${SELECTED_DISKS[@]}"; do - local size=$(lsblk -d -n -o SIZE "$disk" | tr -d ' ') + local size + size=$(lsblk -d -n -o SIZE "$disk" | tr -d ' ') echo " - $disk ($size)" done echo " RAID Level: ${RAID_LEVEL:-single (no RAID)}" @@ -861,7 +865,8 @@ create_datasets() { # Main root filesystem # Reserve 20% of pool or 20G max to prevent pool from filling completely - local pool_size_bytes=$(zpool get -Hp size "$POOL_NAME" | awk '{print $3}') + local pool_size_bytes + pool_size_bytes=$(zpool get -Hp size "$POOL_NAME" | awk '{print $3}') local pool_size_gb=$((pool_size_bytes / 1024 / 1024 / 1024)) local reserve_gb=$((pool_size_gb / 5)) # 20% [[ $reserve_gb -gt 20 ]] && reserve_gb=20 diff --git a/custom/lib/zfs.sh b/custom/lib/zfs.sh index bb948fb..feda91d 100644 --- a/custom/lib/zfs.sh +++ b/custom/lib/zfs.sh @@ -311,7 +311,6 @@ sync_zfs_efi_partitions() { step "Syncing EFI partitions for redundancy" - local primary="${efi_parts[0]}" for ((i=1; i<${#efi_parts[@]}; i++)); do local secondary="${efi_parts[$i]}" local tmp_mount="/tmp/efi_sync_$$" |
