Short drive name
This commit is contained in:
parent
22da3b7a00
commit
8c0d5ed365
|
@ -38,8 +38,10 @@ if [ ! $1 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
USB_DRIVE_SHORT=${1}
|
||||
if [[ "$1" == "/dev/"* ]]; then
|
||||
USB_DRIVE=$1
|
||||
USB_DRIVE_SHORT=$(echo "$USB_DRIVE" | awk -F '/' '{print $3}' | sed 's|1||g' | sed 's|2||g' | sed 's|3||g')
|
||||
else
|
||||
USB_DRIVE=/dev/${1}1
|
||||
fi
|
||||
|
@ -60,7 +62,7 @@ p
|
|||
a
|
||||
1
|
||||
w
|
||||
" | fdisk /dev/${1};mkfs.ext4 -L "$LABEL" /dev/${1}1
|
||||
" | fdisk /dev/${USB_DRIVE_SHORT};mkfs.ext4 -L "$LABEL" /dev/${USB_DRIVE_SHORT}1
|
||||
|
||||
echo $"Formatting $USB_DRIVE as LUKS"
|
||||
cryptsetup -y -v luksFormat ${USB_DRIVE}
|
||||
|
|
Loading…
Reference in New Issue