Follow style guide
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Write iso file to sd card
|
# Write iso file to sd card
|
||||||
iso2sd() {
|
iso2sd() {
|
||||||
if [[ $# -lt 1 ]]; then
|
if (( $# < 1 )); then
|
||||||
echo "Usage: iso2sd <input_file> [output_device]"
|
echo "Usage: iso2sd <input_file> [output_device]"
|
||||||
echo "Example: iso2sd ~/Downloads/ubuntu-25.04-desktop-amd64.iso /dev/sda"
|
echo "Example: iso2sd ~/Downloads/ubuntu-25.04-desktop-amd64.iso /dev/sda"
|
||||||
return 1
|
return 1
|
||||||
@@ -31,7 +31,7 @@ iso2sd() {
|
|||||||
|
|
||||||
# Format an entire drive for a single partition using exFAT
|
# Format an entire drive for a single partition using exFAT
|
||||||
format-drive() {
|
format-drive() {
|
||||||
if [ $# -ne 2 ]; then
|
if (( $# != 2 )); then
|
||||||
echo "Usage: format-drive <device> <name>"
|
echo "Usage: format-drive <device> <name>"
|
||||||
echo "Example: format-drive /dev/sda 'My Stuff'"
|
echo "Example: format-drive /dev/sda 'My Stuff'"
|
||||||
echo -e "\nAvailable drives:"
|
echo -e "\nAvailable drives:"
|
||||||
@@ -40,7 +40,7 @@ format-drive() {
|
|||||||
echo "WARNING: This will completely erase all data on $1 and label it '$2'."
|
echo "WARNING: This will completely erase all data on $1 and label it '$2'."
|
||||||
read -rp "Are you sure you want to continue? (y/N): " confirm
|
read -rp "Are you sure you want to continue? (y/N): " confirm
|
||||||
|
|
||||||
if [[ "$confirm" =~ ^[Yy]$ ]]; then
|
if [[ $confirm =~ ^[Yy]$ ]]; then
|
||||||
sudo wipefs -a "$1"
|
sudo wipefs -a "$1"
|
||||||
sudo dd if=/dev/zero of="$1" bs=1M count=100 status=progress
|
sudo dd if=/dev/zero of="$1" bs=1M count=100 status=progress
|
||||||
sudo parted -s "$1" mklabel gpt
|
sudo parted -s "$1" mklabel gpt
|
||||||
|
|||||||
Reference in New Issue
Block a user