Avoid git clone when executing install.sh inside the project folder

This commit is contained in:
Vincent Hsu 2020-03-17 18:35:40 +08:00
parent ed3725bfa4
commit 6f3cf2642f
2 changed files with 7 additions and 4 deletions

View File

@ -18,6 +18,7 @@ Step 5: Start ngrok service by typing:
or just execute `install.sh` on Linux x64 platform.
```
curl -O https://raw.githubusercontent.com/vincenthsu/systemd-ngrok/master/install.sh
chmod +x install.sh
./install.sh <your_authtoken>
sudo ./install.sh <your_authtoken>
```

View File

@ -10,8 +10,10 @@ if [ -z "$1" ]; then
exit 1
fi
git clone https://github.com/vincenthsu/systemd-ngrok.git
if [ ! -e ngrok.service ]; then
git clone --depth=1 https://github.com/vincenthsu/systemd-ngrok.git
cd systemd-ngrok
fi
cp ngrok.service /lib/systemd/system/
mkdir -p /opt/ngrok
cp ngrok.yml /opt/ngrok
@ -20,7 +22,7 @@ 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
rm ngrok-stable-linux-amd64.zip
chmod +x ngrok
systemctl enable ngrok.service