Short drive name
This commit is contained in:
parent
22da3b7a00
commit
8c0d5ed365
|
@ -38,8 +38,10 @@ if [ ! $1 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
USB_DRIVE_SHORT=${1}
|
||||||
if [[ "$1" == "/dev/"* ]]; then
|
if [[ "$1" == "/dev/"* ]]; then
|
||||||
USB_DRIVE=$1
|
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
|
else
|
||||||
USB_DRIVE=/dev/${1}1
|
USB_DRIVE=/dev/${1}1
|
||||||
fi
|
fi
|
||||||
|
@ -60,7 +62,7 @@ p
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
w
|
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"
|
echo $"Formatting $USB_DRIVE as LUKS"
|
||||||
cryptsetup -y -v luksFormat ${USB_DRIVE}
|
cryptsetup -y -v luksFormat ${USB_DRIVE}
|
||||||
|
|
Loading…
Reference in New Issue