Browse Source

Reformat external storage if it isn't EXT4 (#139)

remove-cors-headers
Luke Childs 4 years ago
committed by GitHub
parent
commit
5ae3de350f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      scripts/umbrel-os/external-storage/mount

7
scripts/umbrel-os/external-storage/mount

@ -54,6 +54,11 @@ get_block_device_model () {
echo "$(echo $vendor) $(echo $model)"
}
is_partition_ext4 () {
partition_path="${1}"
blkid -o value -s TYPE "${partition_path}" | grep --quiet '^ext4$'
}
# Wipes a block device and reformats it with a single EXT4 partition
format_block_device () {
device="${1}"
@ -110,7 +115,7 @@ main () {
mount_partition "${partition_path}"
if [[ -f "${EXTERNAL_UMBREL_ROOT}"/.umbrel ]]; then
if is_partition_ext4 "${partition_path}" && [[ -f "${EXTERNAL_UMBREL_ROOT}"/.umbrel ]]; then
echo "Yes, it does"
else
echo "No, it doesn't"

Loading…
Cancel
Save