-
Notifications
You must be signed in to change notification settings - Fork 4
/
dep.sh
91 lines (82 loc) · 3.45 KB
/
dep.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
#!/bin/sh
#################################################################################
# Title: Cloudbox: Dependencies Installer #
# Author(s): L3uddz, Desimaniac, EnorMOZ #
# URL: https://github.com/Cloudbox/Cloudbox #
# Description: Installs dependencies needed for Cloudbox. #
# -- #
# Part of the Cloudbox project: https://cloudbox.works #
#################################################################################
# GNU General Public License v3.0 #
#################################################################################
# Usage: #
# ====== #
# curl -s https://cloudbox.works/scripts/dep.sh | sudo sh #
# wget -qO- https://cloudbox.works/scripts/dep.sh | sudo sh #
# #
# Custom Ansible Version: #
# curl -s https://cloudbox.works/scripts/dep.sh | sudo sh -s <version> #
# wget -qO- https://cloudbox.works/scripts/dep.sh | sudo sh -s <version> #
#################################################################################
## Constants
readonly PIP="20.3.4"
readonly PIP3="21.0.1"
readonly ANSIBLE="2.5.14"
## Environmental Variables
export DEBIAN_FRONTEND=noninteractive
## Disable IPv6
if [ -f /etc/sysctl.d/99-sysctl.conf ]; then
grep -q -F 'net.ipv6.conf.all.disable_ipv6 = 1' /etc/sysctl.d/99-sysctl.conf || \
echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.d/99-sysctl.conf
grep -q -F 'net.ipv6.conf.default.disable_ipv6 = 1' /etc/sysctl.d/99-sysctl.conf || \
echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.d/99-sysctl.conf
grep -q -F 'net.ipv6.conf.lo.disable_ipv6 = 1' /etc/sysctl.d/99-sysctl.conf || \
echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.d/99-sysctl.conf
sysctl -p
fi
## Install Pre-Dependencies
apt-get install -y --reinstall \
software-properties-common \
apt-transport-https
apt-get update
## Add apt repos
add-apt-repository main
add-apt-repository universe
add-apt-repository restricted
add-apt-repository multiverse
apt-get update
## Install apt Dependencies
apt-get install -y --reinstall \
nano \
git \
build-essential \
libssl-dev \
libffi-dev \
python3-dev \
python3-pip \
python-dev \
python-pip \
python-apt
## Install pip3 Dependencies
python3 -m pip install --disable-pip-version-check --upgrade \
pip==${PIP3}
python3 -m pip install --disable-pip-version-check --upgrade \
setuptools
python3 -m pip install --disable-pip-version-check --upgrade \
pyOpenSSL \
requests \
netaddr
## Install pip2 Dependencies
python -m pip install --disable-pip-version-check --upgrade \
pip==${PIP}
python -m pip install --disable-pip-version-check --upgrade \
setuptools
python -m pip install --disable-pip-version-check --upgrade \
pyOpenSSL \
requests \
netaddr \
jmespath \
ansible==${1-$ANSIBLE}
## Copy pip to /usr/bin
cp /usr/local/bin/pip /usr/bin/pip
cp /usr/local/bin/pip3 /usr/bin/pip3