-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevice_like_loop.sh
More file actions
45 lines (34 loc) · 1006 Bytes
/
device_like_loop.sh
File metadata and controls
45 lines (34 loc) · 1006 Bytes
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
#!/bin/bash
CURRENT_DIR=$(pwd)
FILE_TO_MONITOR="$CURRENT_DIR/02_comment_loop/etc/comment_url.txt"
MIN_LINES=3
get_line_count() {
wc -l < "$FILE_TO_MONITOR"
}
while true; do
LINE_COUNT=$(get_line_count)
CURRENT_TIME=$(date +"%Y-%m-%d %H:%M:%S")
if [ "$LINE_COUNT" -gt "$MIN_LINES" ]; then
printf "$LINE_COUNT/$MIN_LINES $CURRENT_TIME"
# UIAUTO
python3 zz_uiauto_specific.py RF8MB29J8AE
if [ $? -ne 0 ]; then
echo "zz_uiauto_specific.py failed."
continue
fi
# LIKE ALL
python3 $CURRENT_DIR/03_likes/z_fix_urls.py
if [ $? -ne 0 ]; then
echo "z_fix_urls.py failed."
continue
fi
python3 $CURRENT_DIR/03_likes/z_likes.py RF8MB29J8AE
if [ $? -ne 0 ]; then
echo "03_likes/z_likes.py failed."
continue
fi
else
printf "%s\r" "$LINE_COUNT/$MIN_LINES $CURRENT_TIME"
fi
sleep 2
done