forked from ise-uiuc/KernelGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
crash_watcher.sh
executable file
·37 lines (33 loc) · 1.05 KB
/
crash_watcher.sh
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
29
30
31
32
33
34
35
36
37
receiver=$1
directory=$(realpath ${2:-spec-eval})
TMP=".tmp_email.tmp"
NOTIFIED=".notified.tmp"
:>$NOTIFIED
while true; do
:> $TMP
find $directory -type d -name "crashes" | while read crashdir; do
find $crashdir -name "description"| while read desc; do
ds=$(cat $desc)
if ! grep -q "$ds" $NOTIFIED; then
echo "New crash found:" >> $TMP
echo >> $TMP
cat $desc >> $TMP
echo >> $TMP
echo $(realpath $desc) >> $TMP
echo >> $TMP
echo $ds >> $NOTIFIED
search=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$ds'))")
echo "https://www.google.com/search?q=$search" >> $TMP
echo >> $TMP
fi
done
done
if [ -s $TMP ]; then
echo "Machine: $(hostname)" >> $TMP
echo >> $TMP
cat $TMP | mail -s "New Crash Found on $(hostname)" -a "From: syzkaller@$(hostname)" $receiver
fi
rm $TMP
sleep 60
done
rm $NOTIFIED