Remove USB support
This commit is contained in:
+12
-28
@@ -7,6 +7,7 @@ YELLOW='\e[33m'
|
|||||||
RESET='\e[0m'
|
RESET='\e[0m'
|
||||||
|
|
||||||
MOUNT_POINTS=("/dev" "/dev/pts" "/proc" "/sys" "/sys/firmware/efi/efivars" "/run")
|
MOUNT_POINTS=("/dev" "/dev/pts" "/proc" "/sys" "/sys/firmware/efi/efivars" "/run")
|
||||||
|
IMG_FILE="PBX.img3.lz4"
|
||||||
NO_WRITE=false
|
NO_WRITE=false
|
||||||
NO_RETABLE=false
|
NO_RETABLE=false
|
||||||
NO_USB=false
|
NO_USB=false
|
||||||
@@ -93,38 +94,21 @@ update-grub
|
|||||||
echo -e "${GREEN}Restore and resize complete!${RESET}"
|
echo -e "${GREEN}Restore and resize complete!${RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
write_image() {
|
write_img() {
|
||||||
if [[ $NO_USB == true ]]; then
|
img_file_dir="null"
|
||||||
echo "Writing image to $(get_partition $disk_name "3")..."
|
|
||||||
lz4 -dc ./Image/PBX.img3.lz4 | dd of=$(get_partition $disk_name "3") status=progress
|
|
||||||
|
|
||||||
partprobe || true
|
|
||||||
|
|
||||||
|
if [[ -f "./${IMG_FILE}" ]]; then
|
||||||
|
img_file_dir="./${IMG_FILE}"
|
||||||
|
elif [[ ! -f "./Image/${IMG_FILE}" ]]; then
|
||||||
|
img_file_dir="./Image/${IMG_FILE}"
|
||||||
else
|
else
|
||||||
read -rp "Enter the name of the usb partition in /dev/mapper (e.g., sda1): " disk_suffix
|
img_file_dir="null"
|
||||||
|
|
||||||
usb_name="/dev/mapper/${disk_suffix}"
|
|
||||||
|
|
||||||
user_response="n"
|
|
||||||
|
|
||||||
read -rp "$(echo -e "${RED}You are about to WRITE and ERASE disk ${disk_name} | Are you sure? y/N: ${RESET}")" user_response
|
|
||||||
|
|
||||||
if [[ $user_response != y ]]; then
|
|
||||||
echo "Exiting script"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Mounting Ventoy..."
|
|
||||||
mkdir -p /mnt/ventoy
|
|
||||||
mount $usb_name /mnt/ventoy
|
|
||||||
cd /mnt/ventoy/Images
|
|
||||||
|
|
||||||
echo "Writing image to $(get_partition $disk_name "3")..."
|
|
||||||
lz4 -dc PBX.img.lz4 | dd of=$(get_partition $disk_name "3") status=progress
|
|
||||||
|
|
||||||
partprobe || true
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Writing image to $(get_partition $disk_name "3")..."
|
||||||
|
|
||||||
|
lz4 -dc ${img_file_dir} | dd of=$(get_partition $disk_name "3") status=progress
|
||||||
|
partprobe || true
|
||||||
}
|
}
|
||||||
|
|
||||||
rewrite_gpt_table() {
|
rewrite_gpt_table() {
|
||||||
|
|||||||
Reference in New Issue
Block a user