-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.sh
104 lines (94 loc) · 1.87 KB
/
main.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/system/bin/sh
#!/sys/bin/bash
# libraries
function lib(){
# quick install
pip install beautifulsoup4 || pip3 install beautifulsoup4
pip install bs4 || pip3 install bs4
pip install lxml || pip3 install lxml
pip install requests || pip3 install requests
pip install termcolor || pip3 install termcolor
pkg install curl || sudo apt install curl
# else ...
# requests lib
if pip show requests > log
then
rm -rf log
echo "requests library is installed"
else
while true
do
pip install requests
if pip show requests > log
then
rm -rf log
break
fi
done
fi
# beautifulsoup lib
if pip show beautifulsoup4 > log
then
rm -rf log
echo "beautifulsoup4 is already installed"
else
while true
do
pip install beautifulsoup4 bs4
if pip show beautifulsoup4 > log
then
rm -rf log
break
fi
done
fi
# lxml lib
if pip show lxml > log
then
rm -rf log
echo "lxml is already installed"
else
while true
do
pip install lxml
if pip show lxml > log
then
rm -rf log
break
fi
done
fi
# html5lib lib
if pip show html5lib > log
then
rm -rf log
echo "html5lib is already installed"
else
while true
do
pip install html5lib
if pip show html5lib > log
then
rm -rf log
break
fi
done
fi
}
# python check
if command -v python > log
then
rm -rf log
lib
if ![ -f main.py ];then
curl -O https://bartwel27.github.io/httScrap/main.py
python main.py
fi
else
pkg install python || sudo apt install python
lib
if ![ -f main.py ];then
curl -O https://bartwel27.github.io/httScrap/main.py
python main.py
fi
fi