#!/bin/bash if [ $# -eq 0 ]; then echo "Usage: $0 " 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 copy images/ fi else if [ ! -f images/vhd/$vhd ]; then echo "Downloading $file" fi fi done < profiles/$profile/apps.csv