risotto/ansible/sbin/compare_image
2022-12-21 16:35:58 +01:00

22 lines
421 B
Bash
Executable file

#!/bin/bash
SRV=$1
if [ -z "$SRV" ]; then
echo "usage: $0 machine"
exit 1
fi
dirname="/var/lib/risotto/templates/$SRV"
if [ ! -d "$dirname" ]; then
echo "cannot find $dirname"
echo "usage: $0 machine"
exit 1
fi
cd $dirname
find -type f | while read a; do
cfile="/var/lib/machines/$SRV/usr/share/factory/$a"
if [ -f "$cfile" ]; then
diff -u "$cfile" "$a"
fi
done
cd - > /dev/null