fixed return

This commit is contained in:
poslop
2026-01-16 16:19:40 -06:00
parent 265839faae
commit a92e5f05de

View File

@@ -53,15 +53,15 @@ cleanup() {
trap 'echo "Status Code: $?"; cleanup;' EXIT
get_partition() {
$disk_name="$1"
$part_num="$2"
local disk_name="$1"
local part_num="$2"
third_part_dev="$(
lsblk -ln -o NAME,TYPE "$disk_name" \
| awk '$2=="part"{print "/dev/"$1}' \
local part_path="$(
lsblk -lnp -o NAME,TYPE "$disk_name" \
| awk '$2=="part"{print $1}' \
| sed -n "${part_num}p"
)"
return $third_part_dev
printf "$part_path"
}
# Set your target disk here
@@ -106,7 +106,7 @@ fi
# Repartition disk using sgdisk
echo "Repairing partition tables"
sgdisk -e $disk_name
sgdisk -e $disk_name || true
sgdisk -v $disk_name
partprobe || true