blob: 386d2a827ac015d00cc00efb513f0a1ccbf9948d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/bin/sh
#set -x
DURATION=$1
LOGFILE=$2
RESULT_PASS_FILE="./trinity-result-pass"
if [ -f ${RESULT_PASS_FILE} ]; then
rm -f ${RESULT_PASS_FILE}
fi
if [ -f zip_log ]; then
rm -f zip_log
fi
mkfifo zip_log
(gzip -c < zip_log > ${LOGFILE}) &
echo -e "DURATION: ${DURATION}"
# Send SIGKILL to trinity processes after DURATION seconds
(sleep ${DURATION} ; for p in `pgrep trinity`;do [ ! -f ${RESULT_PASS_FILE} ] && touch ${RESULT_PASS_FILE} ; kill -9 $p; done) &
# Remove non-printable ASCII characters by tr
./trinity/trinity -m --dangerous | tr -cd '\11\12\15\40-\176' | tee zip_log
if [ -f ${RESULT_PASS_FILE} ]; then
exit 0
else
exit 1
fi
|