systemd-ngrok/install.sh
2019-02-15 16:52:16 +08:00

26 lines
568 B
Bash
Executable File

#!/usr/bin/env bash
if (( $EUID != 0 )); then
echo "Please run as root"
exit 1
fi
if [ -z "$1" ]; then
echo "./install.sh <your_authtoken>"
exit 1
fi
git clone https://github.com/vincenthsu/systemd-ngrok.git
cd systemd-ngrok
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-amd64.zip
unzip ngrok-stable-linux-amd64.zip
systemctl enable ngrok.service
systemctl start ngrok.service