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