forked from prescient-devices/ngrok-edge-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·39 lines (32 loc) · 843 Bytes
/
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
#!/usr/bin/env bash
if [ ! $(which wget) ]; then
echo 'Please install wget package'
exit 1
fi
if [ ! $(which unzip) ]; then
echo 'Please install zip package'
exit 1
fi
if (( $EUID != 0 )); then
echo "Please run as root"
exit 1
fi
if [ -z "$1" ]; then
echo "./install.sh <your_authtoken>"
exit 1
fi
if [ ! -e ngrok.service ]; then
git clone --depth=1 https://github.com/prescient-devices/ngrok-edge-client.git
cd ngrok-edge-client
fi
cp ngrok.service /lib/systemd/system/
mkdir -p /opt/ngrok
cp ngrok.yml /opt/ngrok
sed -i "s/<add_your_token_here>/$1/g" /opt/ngrok/ngrok.yml
cd /opt/ngrok
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
unzip ngrok-stable-linux-arm.zip
rm ngrok-stable-linux-arm.zip
chmod +x ngrok
systemctl enable ngrok.service
systemctl start ngrok.service