mirror of
https://github.com/vincenthsu/systemd-ngrok.git
synced 2025-05-07 12:06:10 +00:00
Add install/uninstall scripts
This commit is contained in:
parent
fabd6e9979
commit
d246db2f5f
18
README.md
18
README.md
|
@ -1,15 +1,23 @@
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
|
Step 1: Place [`ngrok`](https://ngrok.com/download) in `/opt/ngrok/`.
|
||||||
|
|
||||||
Step 1: Place [`ngrok`](https://ngrok.com/download) in `/opt/ngrok/`
|
Step 2: Get `authtoken` from ngrok website, then add it to `/opt/ngrok/ngrok.yml`.
|
||||||
|
|
||||||
Step 2: Get `authtoken` from ngrok website, then add it to `/opt/ngrok/ngrok.yml`
|
Step 3. Modify your own configrations in `/opt/ngrok/ngrok.yml`.
|
||||||
|
|
||||||
Step 3: Add `ngrok.service` to `/etc/systemd/system/`
|
Step 4: Add `ngrok.service` to `/lib/systemd/system/`.
|
||||||
|
|
||||||
|
Step 5: Start ngrok service by typing:
|
||||||
|
|
||||||
Step 4: Start ngrok service by typing:
|
|
||||||
```
|
```
|
||||||
systemctl daemon-reload
|
|
||||||
systemctl enable ngrok.service
|
systemctl enable ngrok.service
|
||||||
systemctl start ngrok.service
|
systemctl start ngrok.service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
or just execute `install.sh` on Linux x64 platform.
|
||||||
|
|
||||||
|
```
|
||||||
|
chmod +x install.sh
|
||||||
|
./install.sh <your_authtoken>
|
||||||
|
```
|
||||||
|
|
25
install.sh
Executable file
25
install.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/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
|
11
uninstall.sh
Executable file
11
uninstall.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if (( $EUID != 0 )); then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
systemctl stop ngrok.service
|
||||||
|
systemctl disable ngrok.service
|
||||||
|
rm /lib/systemd/system/ngrok.service
|
||||||
|
rm -rf /opt/ngrok
|
Loading…
Reference in New Issue
Block a user