-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
lh21
61 lines (60 loc) · 985 Bytes
/
lh21
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
DPIDDD=$$
echo $DPIDDD > /root/lscript/dpiddd.txt
i=1
delay="$Del"
if [[ "$delay" == "" ]]
then
delay=5
fi
while [[ "$i" == 1 ]]
do
TEMP=$(pyrit -r "$HANDCAP" analyze 2>/dev/null)
TEMPHANDD=$(echo "$TEMP" | grep "good")
TEMPHAND=$(echo "$TEMP" | grep "workable")
if [[ "$TEMPHANDD" == "" && "$TEMPHAND" == "" ]]
then
printf "."
else
clear
echo -e "HANDSHAKE FOUND!"
sleep 2
echo -e "Exiting terminals..."
sleep 1
if [[ -f "$LPATH"/dpid.txt ]]
then
read DPID < "$LPATH"/dpid.txt
PIF=$(ps -A | grep "$DPID")
if [[ "$PIF" != "" ]]
then
kill $DPID
fi
fi
break
fi
sleep "$delay"
done
j=1
while true
do
PIDSE="dpid"$j".txt"
if [[ -f "$LPATH"/"$PIDSE" ]]
then
read DPID < "$LPATH"/"$PIDSE"
PIF=$(ps -A | grep "$DPID")
if [[ "$PIF" != "" ]]
then
kill $DPID
fi
else
rm "$LPATH"/dpid*
break
fi
j=$((j+1))
done
if [[ -f "$LPATH"/dpidd.txt ]]
then
read DPID2 < /root/lscript/dpidd.txt
kill -INT $DPID2
fi
exit