fix mk-enc-usb
This commit is contained in:
parent
65165b4a9d
commit
f41ae25fa9
|
@ -21,12 +21,6 @@ in (writeShellApplication {
|
||||||
# e.g /dev/sdb
|
# e.g /dev/sdb
|
||||||
USB_DEVICE=$1
|
USB_DEVICE=$1
|
||||||
|
|
||||||
if echo "$USB_DEVICE" | grep -q "[0-9]$"; then
|
|
||||||
PARTITION_SEPARATOR="p"
|
|
||||||
else
|
|
||||||
PARTITION_SEPARATOR=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
echo "Please run as root"
|
echo "Please run as root"
|
||||||
exit
|
exit
|
||||||
|
@ -39,10 +33,10 @@ in (writeShellApplication {
|
||||||
parted "$USB_DEVICE" -- mkpart primary 0% 100%
|
parted "$USB_DEVICE" -- mkpart primary 0% 100%
|
||||||
|
|
||||||
echo "Creating Encrypted Partition"
|
echo "Creating Encrypted Partition"
|
||||||
cryptsetup luksFormat "''${USB_DEVICE}''${PARTITION_SEPARATOR}1"
|
cryptsetup luksFormat "$USB_DEVICE"
|
||||||
|
|
||||||
echo "Opening Encrypted Partition"
|
echo "Opening Encrypted Partition"
|
||||||
cryptsetup open "''${USB_DEVICE}''${PARTITION_SEPARATOR}1" "mk_enc_usb"
|
cryptsetup open "$USB_DEVICE" "mk_enc_usb"
|
||||||
|
|
||||||
echo "Making Encrypted Filesystem"
|
echo "Making Encrypted Filesystem"
|
||||||
mkfs.ext4 -L "${encryptedUSBData.unencryptedLabel}" /dev/mapper/mk_enc_usb
|
mkfs.ext4 -L "${encryptedUSBData.unencryptedLabel}" /dev/mapper/mk_enc_usb
|
||||||
|
|
Loading…
Reference in a new issue