| 1 |
#!/bin/sh |
| 2 |
# Copyright (C) 2000-2020 Kern Sibbald |
| 3 |
# License: BSD 2-Clause; see file LICENSE-FOSS |
| 4 |
# |
| 5 |
# Sign binaries if possible with sign_exe script |
| 6 |
|
| 7 |
DIR=$1 |
| 8 |
|
| 9 |
if [ "$DIR" = "" ]; then |
| 10 |
echo "Usage: $0 <directory> | <file> <file> <file>" |
| 11 |
exit 1 |
| 12 |
fi |
| 13 |
|
| 14 |
if ! which sign_exe > /dev/null 2> /dev/null |
| 15 |
then |
| 16 |
exit 0 |
| 17 |
fi |
| 18 |
|
| 19 |
RET=0 |
| 20 |
|
| 21 |
if [ -d "$DIR" ]; then |
| 22 |
for F in "$DIR"/*.exe "$DIR"/*.dll |
| 23 |
do |
| 24 |
sign_exe "$F" |
| 25 |
RET=`expr $RET + $?` |
| 26 |
done |
| 27 |
|
| 28 |
else |
| 29 |
for F in $* |
| 30 |
do |
| 31 |
sign_exe "$F" |
| 32 |
RET=`expr $RET + $?` |
| 33 |
done |
| 34 |
fi |
| 35 |
|
| 36 |
exit $RET |