@@ -6,7 +6,6 @@ DAPPNODE_DIR="/usr/src/dappnode"
6
6
LOGS_DIR=" $DAPPNODE_DIR /logs"
7
7
lsb_dist=" $( . /etc/os-release && echo " $ID " ) "
8
8
9
-
10
9
#! ISOBUILD Do not modify, variables above imported for ISO build
11
10
12
11
detect_installation_type () {
@@ -20,24 +19,23 @@ detect_installation_type() {
20
19
fi
21
20
}
22
21
23
-
24
22
add_docker_repo () {
25
23
apt-get update -y
26
24
apt-get remove -y docker docker-engine docker.io containerd runc | tee -a $LOG_FILE
27
25
apt-get install -y ca-certificates curl gnupg lsb-release | tee -a $LOG_FILE
28
26
mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings
29
27
curl -fsSL " https://download.docker.com/linux/${lsb_dist} /gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
30
28
chmod a+r /etc/apt/keyrings/docker.gpg
31
- echo " deb [arch=$( dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$lsb_dist $( lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
29
+ echo " deb [arch=$( dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$lsb_dist $( lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
32
30
}
33
31
34
32
# DOCKER INSTALLATION
35
33
install_docker () {
36
34
apt-get update -y
37
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin | tee -a $LOG_FILE
35
+ apt-get install -y docker-ce docker-ce-cli containerd.io | tee -a $LOG_FILE
38
36
39
37
# Ensure xz is installed
40
- [ -f " /usr/bin/xz" ] || ( apt-get install -y xz-utils)
38
+ [ -f " /usr/bin/xz" ] || (apt-get install -y xz-utils)
41
39
42
40
USER=$( grep 1000 " /etc/passwd" | cut -f 1 -d:)
43
41
[ -z " $USER " ] || usermod -aG docker " $USER "
@@ -56,50 +54,50 @@ install_docker() {
56
54
57
55
# DOCKER-COMPOSE FOR LEGACY SCRIPTS, SHOULD BE REMOVED EVENTUALLY
58
56
alias_docker_compose () {
59
- cat > /usr/local/bin/docker-compose<< EOL
57
+ cat > /usr/local/bin/docker-compose << EOL
60
58
#!/bin/bash
61
59
docker compose "\$ @"
62
60
EOL
63
61
chmod +x /usr/local/bin/docker-compose
64
62
}
65
63
66
- # WIREGUARD INSTALLATION
64
+ # WIREGUARD INSTALLATION
67
65
install_wireguard_dkms () {
68
66
apt-get update -y
69
67
70
68
apt-get install wireguard-dkms -y | tee -a $LOG_FILE
71
69
72
- if modprobe wireguard > /dev/null 2>&1 ; then
70
+ if modprobe wireguard > /dev/null 2>&1 ; then
73
71
echo -e " \e[32m \n\n Verified wiregurd-dkms installation \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
74
72
else
75
73
echo -e " \e[31m \n\n WARNING: wireguard kernel module is not installed, Wireguard DAppNode package might not work! \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
76
74
fi
77
75
}
78
76
79
- # LSOF INSTALLATION: used to scan host port 80 in use, https package installation will deppend on it
77
+ # LSOF INSTALLATION: used to scan host port 80 in use, https package installation will deppend on it
80
78
install_lsof () {
81
79
apt-get update -y
82
80
apt-get install lsof -y | tee -a $LOG_FILE
83
- if lsof -v > /dev/null 2>&1 ; then
81
+ if lsof -v > /dev/null 2>&1 ; then
84
82
echo -e " \e[32m \n\n Verified lsof installation \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
85
83
else
86
84
echo -e " \e[31m \n\n WARNING: lsof not installed, HTTPS DAppNode package might not be installed! \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
87
85
fi
88
86
}
89
87
90
88
# IPTABLES INSTALLATION: mandatory for docker, on bullseye is not installed by default
91
- install_iptables () {
89
+ install_iptables () {
92
90
apt-get update -y
93
91
apt-get install iptables -y | tee -a $LOG_FILE
94
- if iptables -v > /dev/null 2>&1 ; then
92
+ if iptables -v > /dev/null 2>&1 ; then
95
93
echo -e " \e[32m \n\n Verified iptables installation \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
96
94
else
97
95
echo -e " \e[31m \n\n WARNING: iptables not installed, Docker may not work! \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
98
96
fi
99
97
}
100
98
101
99
# HOST UPDATE
102
- host_update () {
100
+ host_update () {
103
101
apt-get update 2>&1 | tee -a $LOG_FILE
104
102
apt-get -y upgrade 2>&1 | tee -a $LOG_FILE
105
103
}
@@ -122,8 +120,7 @@ if [ "$1" == "UPDATE" ]; then
122
120
host_update 2>&1 | tee -a $LOG_FILE
123
121
fi
124
122
125
-
126
- if find /etc/apt/ -name " *.list" -print0 | xargs --null cat | grep -q " https://download.docker.com/linux/$lsb_dist " ; then
123
+ if find /etc/apt/ -name " *.list" -print0 | xargs --null cat | grep -q " https://download.docker.com/linux/$lsb_dist " ; then
127
124
echo -e " \e[32m \n\n docker repo is already added \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
128
125
else
129
126
add_docker_repo | tee -a $LOG_FILE
@@ -136,15 +133,8 @@ else
136
133
install_docker 2>&1 | tee -a $LOG_FILE
137
134
fi
138
135
139
- # Only install docker-compose if needed
140
- if docker-compose -v > /dev/null 2>&1 ; then
141
- echo -e " \e[32m \n\n docker-compose is already aliased \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
142
- else
143
- alias_docker_compose 2>&1 | tee -a $LOG_FILE
144
- fi
145
-
146
136
# Only install wireguard-dkms if needed
147
- if modprobe wireguard > /dev/null 2>&1 ; then
137
+ if modprobe wireguard > /dev/null 2>&1 ; then
148
138
echo -e " \e[32m \n\n wireguard-dkms is already installed \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
149
139
else
150
140
install_wireguard_dkms 2>&1 | tee -a $LOG_FILE
@@ -158,15 +148,22 @@ else
158
148
fi
159
149
160
150
# Check connectivity
161
- { [ -f /etc/network/interfaces ] && grep " iface en.* inet dhcp" /etc/network/interfaces & > /dev/null; } || { echo " Interfaces not found" ; exit 1; }
151
+ { [ -f /etc/network/interfaces ] && grep " iface en.* inet dhcp" /etc/network/interfaces & > /dev/null; } || {
152
+ echo " Interfaces not found"
153
+ exit 1
154
+ }
162
155
163
156
# # Add missing interfaces
164
157
if [ -f /usr/src/dappnode/hotplug ]; then
165
158
# shellcheck disable=SC2013
166
159
for IFACE in $( grep " en.*" /usr/src/dappnode/hotplug) ; do
167
160
# shellcheck disable=SC2143
168
161
if [[ $( grep -L " $IFACE " /etc/network/interfaces) ]]; then
169
- { echo " # $IFACE " ; echo " allow-hotplug $IFACE " ; echo " iface $IFACE inet dhcp" ; } >> /etc/network/interfaces
162
+ {
163
+ echo " # $IFACE "
164
+ echo " allow-hotplug $IFACE "
165
+ echo " iface $IFACE inet dhcp"
166
+ } >> /etc/network/interfaces
170
167
fi
171
168
done
172
169
fi
0 commit comments