From 8b48a1196099afa259640eac515ef14ed49d85d9 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Thu, 10 Feb 2022 16:01:51 +0100 Subject: [PATCH] bin/update-e2b: add ability to provide new ISOs --- .local/bin/scripts/update-e2b | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.local/bin/scripts/update-e2b b/.local/bin/scripts/update-e2b index 35b9b7b..35bf59b 100755 --- a/.local/bin/scripts/update-e2b +++ b/.local/bin/scripts/update-e2b @@ -1,9 +1,11 @@ -#!/bin/sh +#!/bin/sh -e # 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 \; +# Call with Linux ISOs to be copied as args +# Need to be around E2B mountpoint if it is not the default +dir="$(find -maxdepth 2 -name E2B -type d | grep . || echo "${MNT:-${XDG_RUNTIME_DIR}/mnt}/E2B")" +test $# -eq 0 || mv -vi "$@" "$dir/_ISO/LINUX" +find "$dir" -name "*32-*.iso" -exec mv -vi {} {}def32 \; +find "$dir" -name "*.iso" -exec mv -vi {} {}def64 \; drive=$(mount | grep "$dir" | cut -d' ' -f1) sudo umount $drive sudo udefrag $drive