-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinstall.sh
43 lines (37 loc) · 1.27 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
#!/bin/bash
# install basic packages
apt-get -y update \
&& apt-get -y dist-upgrade \
&& apt-get -y install sudo bash nano
# install stubby
apt-get -y update \
&& apt-get -y install stubby
# clean stubby config
mkdir -p /etc/stubby \
&& rm -f /etc/stubby/stubby.yml
# install cloudflared
if [[ ${TARGETPLATFORM} =~ "arm" ]]
then
cd /tmp \
&& wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz \
&& tar -xvzf ./cloudflared-stable-linux-arm.tgz \
&& cp ./cloudflared /usr/local/bin \
&& rm -f ./cloudflared-stable-linux-arm.tgz \
&& echo "Cloudflared installed for arm due to tag ${TAG}"
else
cd /tmp \
&& wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-amd64.deb \
&& apt install ./cloudflared-stable-linux-amd64.deb \
&& rm -f ./cloudflared-stable-linux-amd64.deb \
&& echo "Cloudflared installed for amd64 due to tag ${TAG}"
fi
useradd -s /usr/sbin/nologin -r -M cloudflared \
&& chown cloudflared:cloudflared /usr/local/bin/cloudflared
# clean cloudflared config
mkdir -p /etc/cloudflared \
&& rm -f /etc/cloudflared/config.yml
# clean up
apt-get -y autoremove \
&& apt-get -y autoclean \
&& apt-get -y clean \
&& rm -fr /tmp/* /var/tmp/* /var/lib/apt/lists/*