Skip to content

Commit

Permalink
Reformat external storage if it isn't EXT4 (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds authored Aug 15, 2020
1 parent 8b3b077 commit 5ae3de3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/umbrel-os/external-storage/mount
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 5ae3de3

Please sign in to comment.