-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
104 lines (73 loc) · 1.8 KB
/
install.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/bin/env bash
# Bash Strict Mode
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
if [ "$EUID" -ne 0 ]; then
echo "Please run as root."
exit
fi
rl-update-upgrade () {
echo -e "\e[1mUpdating and Upgrading...\e[0m"
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
echo -e "\e[32mSuccess!\e[0m"
echo ""
}
rl-cleanup () {
echo -e "\e[1mCleaning up...\e[0m"
apt-get autoclean -y
apt-get autoremove -y
echo -e "\e[32mSuccess!\e[0m"
echo ""
}
rl-join-systemd-journal-group () {
# Join the systemd-journal group to get access to system wide journal.
usermod -a -G systemd-journal pi
}
rl-set-timezone () {
# Set local time zone
timedatectl set-timezone America/Los_Angeles
}
rl-set-locale () {
# Uncomment en_US.UTF-8 for inclusion in generation
sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen
# Generate locale
locale-gen
# Set default locale
update-locale LANG=en_US.UTF-8
}
rl-install-build-essentials () {
echo -e "\e[1mInstalling Build Essentials\e[0m"
apt-get install -y build-essential
apt-get install -y libssl-dev
apt-get install -y libffi-dev
echo -e "\e[32mSuccess!\e[0m"
echo ""
}
rl-install-python () {
echo -e "\e[1mInstalling Python\e[0m"
apt-get install -y python3
apt-get install -y python3-pip
apt-get install -y python3-venv
pip3 install --upgrade pip
echo -e "\e[32mSuccess!\e[0m"
echo ""
}
rl-install-docker () {
echo -e "\e[1mInstalling docker\e[0m"
curl -sSL https://get.docker.com | sh
usermod -aG docker pi
echo -e "\e[32mSuccess!\e[0m"
echo ""
}
rl-join-systemd-journal-group
rl-update-upgrade
rl-set-timezone
rl-set-locale
rl-install-build-essentials
rl-install-python
rl-install-docker # Requires build-essentials, python
rl-cleanup
echo -e "\e[32mInstalling completed successfully!\e[0m"