Skip to content

Instantly share code, notes, and snippets.

@jamespo

jamespo/zip2lha.sh

Created May 3, 2020
Embed
What would you like to do?
zip2lha.sh - convert zip files (for WHDLOAD) into lha for retropie / amiberry
#!/bin/bash
# zip2lha.sh - convert zip files (for WHDLOAD) into lha for retropie / amiberry
# USAGE: zip2lha.sh zipfilename.zip
# or to do whole directory: find . -name '*.zip -exec zip2lha.sh {} \;
# set TMPDIR & DESTDIR in script
# REQUIREMENTS: unzip & jlha-utils (NOT lha package) on raspbian
# BE CAREFUL! This script removes contents of TMPDIR after each conversion
FN=$1
LHAFN=$(echo $FN |sed -e 's/.zip/.lha/')
TMPDIR=/data/tmp
DESTDIR=/data/roms/amiga/Amiga1
echo "Extracting $FN to $LHAFN"
unzip -d $TMPDIR "$FN" > /dev/null
cd $TMPDIR
jlha -ao5 "$LHAFN" * > /dev/null
mv "$LHAFN" $DESTDIR
rm -rf *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.