This repository has been archived by the owner on Sep 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathsetup.sh
executable file
·82 lines (81 loc) · 2.25 KB
/
setup.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
#!/bin/bash
py=false
pyv=2
python3='py'
if command -v python &>/dev/null
then
echo "[setup.sh] > Python is installed"
py=true
pyv="$(python -V 2>&1)"
echo "[setup.sh] > Version: $pyv"
else
echo "[setup.sh] > python not accesible from the script"
fi
if command -v python3 &>/dev/null
then
echo "[setup.sh] > Python 3 is installed"
py=true
pyv="$(python3 -V 2>&1)"
echo "[setup.sh] > Version: $pyv"
else
echo "[setup.sh] > python3 command is not accesible from the script"
# python3='python'
fi
if [ ! $py ]
then
echo '[setup.sh] > Python not found'
echo '[setup.sh] > Install using sudo?(Y/n)'
read installpy
if [ $installpy == "Y" -o $installpy == "y" -o $installpy == "yes" ]
then
echo sudo apt-get install python3 python3-pip
sudo apt-get install python3 python3-pip
echo '[setup.sh] > Python is installed'
else
echo "[setup.sh] > Please install python3"
fi
fi
if $py
then
$python3 -c "import Cryptodome" &>/dev/null
if [ $? -ne 0 ]
then
echo '[setup.sh] > Installing Crypto for python'
$python3 -m pip install --user pycryptodomex
fi
$python3 -c "import requests" &>/dev/null
if [ $? -ne 0 ]
then
echo '[setup.sh] > Installing requests for python'
$python3 -m pip install --user requests
fi
$python3 -c "import hashlib" &>/dev/null
if [ $? -ne 0 ]
then
echo '[setup.sh] > Installing hashlib for python'
$python3 -m pip install --user hashlib
fi
$python3 -m pip install --user -U -r requirements.txt
$python3 -c "import Cryptodome" &>/dev/null
if [ $? -ne 0 ]
then
echo '[setup.sh] > Installing Cryptodome failed'
else
echo '[setup.sh] > Installing Cryptodome successful'
fi
$python3 -c "import requests" &>/dev/null
if [ $? -ne 0 ]
then
echo '[setup.sh] > Installing requests failed'
else
echo '[setup.sh] > Installing requests successful'
fi
$python3 -c "import hashlib" &>/dev/null
if [ $? -ne 0 ]
then
echo '[setup.sh] > Installing hashlib failed'
else
echo '[setup.sh] > Installing hashlib successful'
fi
echo '[setup.sh] > pycryptodomex, hashlib, requests for python installed'
fi