-
Notifications
You must be signed in to change notification settings - Fork 51
/
twitter.vpn.sh
41 lines (41 loc) · 990 Bytes
/
twitter.vpn.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
38
39
40
41
#!/bin/bash
IFS=$'\n'
hma-vpn -s >/dev/null 2>/dev/null
if [[ $? == 0 ]];then
echo "Déconnecter votre vpn avant d'agir"
exit
fi
for name in `cat $2`; do
echo "*************** $name ***************"
hma-vpn -c /usr/share/hma-vpn/hmalogin -d London >/dev/null 2>/dev/null
hma-vpn -s >/dev/null 2>/dev/null
cpt=0
res=1
while [[ $res != 0 ]]; do
sleep 2
(( cpt= $cpt +1 ))
if [[ $cpt == 20 ]];then
echo "reload vpn"
hma-vpn -c /usr/share/hma-vpn/hmalogin -d London >/dev/null 2>/dev/null
fi
hma-vpn -s >/dev/null 2>/dev/null
res=$?
done
date
hma-vpn -s
ip=$(/tmp/hma-ipcheck.sh)
echo $ip
notify-send "$ip"
(./TwitterReport.py -u $name -i $1 >/dev/null 2>/dev/null)&
p=$!
sleep 10
./TwitterReport.py -u $name -i newlist2.txt >/dev/null 2>/dev/null
echo "Sortie $?"
while ps $p >/dev/null
do
sleep 60
done
hma-vpn -x >/dev/null 2>/dev/null
sleep 1
done
exit