diff --git a/README.md b/README.md index 4484632..c1336d1 100644 --- a/README.md +++ b/README.md @@ -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 + sudo ./install.sh ``` diff --git a/install.sh b/install.sh index 9069711..f9ea057 100755 --- a/install.sh +++ b/install.sh @@ -10,8 +10,10 @@ if [ -z "$1" ]; then exit 1 fi -git clone https://github.com/vincenthsu/systemd-ngrok.git -cd systemd-ngrok +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//$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