dotfiles/.local/bin/scripts/update-e2b

10 lines
333 B
Plaintext
Raw Normal View History

2022-01-08 20:47:30 +00:00
#!/bin/sh
# Update an Easy2Boot USB Stick after adding ISOs
# To be called with target as arg
dir="${1:-${MNT:-${XDG_RUNTIME_DIR}/mnt}/E2B}"
find "$dir" -name "*32-*.iso" -exec mv -v {} {}def32 \;
find "$dir" -name "*.iso" -exec mv -v {} {}def64 \;
drive=$(mount | grep "$dir" | cut -d' ' -f1)
sudo umount $drive
sudo udefrag $drive