Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 23 lines (18 sloc) 572 Bytes
#!/bin/bash
TARGET="$1"
MODIFIED_FILES_FOUND=NO
find "$TARGET" -name _CodeSignature -and \( -not -path \*.dSYM/\* \) | while read line; do
if ! codesign -vvvvv "$line"/../..; then
echo "error: Detected modification in respect to signature $line." >&2
MODIFIED_FILES_FOUND=YES
fi
done
find "$TARGET" -name \*.dylib -and \( -not -path \*.dSYM/\* \) | while read line; do
if ! codesign -vvvvv "$line"; then
echo "error: Detected modification in signed file $line." >&2
MODIFIED_FILES_FOUND=YES
fi
done
if [ "$MODIFIED_FILES_FOUND" == "YES" ]; then
exit 1
fi