From b88f77de2308bc23255cbef39304949ffe4a36fb Mon Sep 17 00:00:00 2001 From: stefan230 Date: Mon, 9 Mar 2020 18:04:03 +0100 Subject: [PATCH] more Linux Mint Custom-ISO shell script cleanups --- mint/linux_mint_custom_iso.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/mint/linux_mint_custom_iso.sh b/mint/linux_mint_custom_iso.sh index a91b390..d838516 100755 --- a/mint/linux_mint_custom_iso.sh +++ b/mint/linux_mint_custom_iso.sh @@ -5,30 +5,29 @@ UNATTENDED="unattended-$1" # => unattended-linuxmint-19.3-cinnamon-64bit.iso #catch if argument 1 is empty. Without the ISO as an argument this script won't work -if [ -z "$1" ] - -then echo "Usage: $0 [linuxmint-original.iso]" -exit +if [[ -z $1 ]] + then echo "Usage: $0 [linuxmint-original.iso]" + exit #catch if the file cannot be found or is misspelled. elif [[ ! -f $1 ]]; then -echo "File not found: $1" >&2 -exit 1 + echo "File not found: $1" >&2 + exit 1 -else +fi #creates a folders that is used during the process. mkdir iso #copies the iso to the created folder and makes the installed files writable. -bsdtar -xf $1 -C ./iso +bsdtar -xf "$1" -C ./iso chmod -R u+w ./iso #copies the computertruhe.seed from codeberg-repo so always the latest preseed-file is used. curl https://codeberg.org/Computertruhe/Setup-Skripte/raw/branch/master/mint/computertruhe.seed > ./iso/preseed/linuxmint.seed #creates the custom-iso with the given parameters. -mkisofs -D -r -V "UNATTENDED_MINT" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $UNATTENDED ./iso +mkisofs -D -r -V "UNATTENDED_MINT" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o "$UNATTENDED" ./iso #umounts the iso and clears up the space we used to create the iso. rm -rf ./iso @@ -36,4 +35,3 @@ rm -rf ./iso #from here we are basically done and the iso can be "burned" on an USB ready for install. echo "Die Custom ISO wurde fertiggestellt und kann nun verwendet werden. Die ISO ist unter $UNATTENDED zu finden." -fi