Fail if compiled binary is dynamic

This commit is contained in:
Quentin Dufour
2022-07-20 14:44:30 +02:00
parent ac03fa7937
commit 76cb34a0ae
3 changed files with 98 additions and 65 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -e
if [ "$#" -ne 1 ]; then
echo "[fail] usage: $0 binary"
exit 2
fi
if file $1 | grep 'dynamically linked' 2>&1; then
echo "[fail] $1 is dynamic"
exit 1
fi
echo "[ok] $1 is probably static"