From 9e82c96713989a7565eadac505b36e3dbe91cd5a Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 11 Jun 2023 07:56:17 -0400 Subject: Added, removed, renamed scripts --- .local/bin/cryptusb/create-cryptusb | 34 ---------------------------------- .local/bin/cryptusb/sync-cryptusb | 8 -------- 2 files changed, 42 deletions(-) delete mode 100755 .local/bin/cryptusb/create-cryptusb delete mode 100755 .local/bin/cryptusb/sync-cryptusb (limited to '.local/bin/cryptusb') diff --git a/.local/bin/cryptusb/create-cryptusb b/.local/bin/cryptusb/create-cryptusb deleted file mode 100755 index e0f49fe..0000000 --- a/.local/bin/cryptusb/create-cryptusb +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# Prompts for and creates a LUKS encrypted partition on a device - -# Get disks connected to the system that are hotpluggable (USBs) -devices="$(lsblk -lp -o NAME,SIZE,HOTPLUG,TYPE | grep "1 disk" | awk '{print $1,"-",$2}')" -[ "$devices" = "" ] && echo "no devices available" && exit 0 - -# Prompt for device selection from the user -select=$(echo "$devices" | dmenu -i -p "Select a device") -[ "$select" = "" ] && echo "no device selected" && exit 0 - -# Get confirmation since this is a potentially dangerous operation -yn=$(echo "No\nYes" | dmenu -i -p "Create encrypted partition on $select") -[ "$yn" != "Yes" ] && exit 0 - -# Get device path from selection string -usb=$(echo $select | cut -d ' ' -f 1) -echo $usb - -# Create LUKS partition on selected device (user will be promted for password to encrypt) -sudo cryptsetup --type luks2 luksFormat "$usb" - -# Open device and create filesystem on partition -echo "creating filesystem" -map_name="crypt-create" -sudo cryptsetup open "$usb" "$map_name" -sudo mkfs.ext4 "/dev/mapper/$map_name" - -# Close device after creating filesystem -sudo cryptsetup close "$map_name" - -echo "done" - - diff --git a/.local/bin/cryptusb/sync-cryptusb b/.local/bin/cryptusb/sync-cryptusb deleted file mode 100755 index 6ba2737..0000000 --- a/.local/bin/cryptusb/sync-cryptusb +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Syncs important files to encrypted USB - -mount-device && \ -rsync -avP --exclude="virtual_machines*" --exclude="media*" \ - --exclude="*.iso" --exclude="*.qcow2" \ - $HOME/ /mnt/cryptusb/$USER@$(hostname)/ && \ -unmount-device -- cgit v1.2.3