22 lines
No EOL
774 B
Bash
Executable file
22 lines
No EOL
774 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
|
|
vhd=$(basename "$url" | sed -E "s/.app/.vhd/")
|
|
if [ -f "images/vhd/$vhd" ]; then
|
|
input=$(vhdiinfo images/vhd/$vhd)
|
|
|
|
identifier=$(echo "$input" | grep -i "Identifier" | head -1 | awk '{print $NF}')
|
|
parent_identifier=$(echo "$input" | grep -i "Parent identifier" | awk '{print $NF}')
|
|
parent_filename=$(echo "$input" | grep -i "Parent filename" | awk -F': ' '{print $2}')
|
|
|
|
echo $vhd,$version,$identifier,$backingversion,$parent_identifier,$parent_filename >> images/lookup/phase1_$1.csv
|
|
else
|
|
echo "images/vhd/$vhd not found"
|
|
fi
|
|
done < profiles/$profile/apps.csv |