wackman/extractapps.sh
2025-09-19 18:14:48 +02:00

35 lines
864 B
Bash
Executable file

#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: $0 <profile>"
exit 1
fi
profile="$1"
while IFS=, read -r version backingversion url
do
file=$(basename "$url")
vhd=$(basename "$url" | sed -E "s/.app/.vhd/")
if [ -f images/app/$file ]; then
echo "Found $file"
if [ -f images/vhd/$vhd ]; then
echo "Found $vhd"
else
echo "Decrypting $file"
fsdecrypt images/app/$file
mkdir -p images/vhd
mv images/app/*.vhd images/vhd/
fi
else
if [ ! -f images/vhd/$vhd ]; then
echo "Downloading $file"
aria2c -x 8 -j 8 -o images/app/$file $url
echo "Decrypting $file"
fsdecrypt images/app/$file
mkdir -p images/vhd
mv images/app/*.vhd images/vhd
fi
fi
done < profiles/$profile/apps.csv