-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallngrok.sh
More file actions
29 lines (29 loc) · 1.03 KB
/
installngrok.sh
File metadata and controls
29 lines (29 loc) · 1.03 KB
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
#!/bin/bash
if ! grep -qi "Debian" /etc/*release; then
echo "not using Debiab or a Debian-based distro, aborting ( Fedora and other distros not added )"
exit 1
fi
if [ ! -f $HOME/.local/bin/ngrok ]; then
curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
| sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \
&& echo "deb https://ngrok-agent.s3.amazonaws.com bookworm main" \
| sudo tee /etc/apt/sources.list.d/ngrok.list \
&& sudo apt update \
&& sudo apt install ngrok -y
clear
while true; do
read -p "Ngrok is now installed, enter your ngrok authtoken key: " Ngrok_authtoken
sudo mv /usr/local/bin/ngrok $HOME/.local/bin/ngrok
if ! grep "2x_" $Ngrok_authtoken; then
echo "Invalid token, try again..."
read -p "Ngrok is now installed, enter your ngrok authtoken key: " Ngrok_authtoken
else
ngrok config add-authtoken $Ngrok_authtoken
sudo mv /usr/local/bin/ngrok $HOME/.local/bin/ngrok
echo 'export PATH="$HOME/.local/bin/ngrok:$PATH"' >> $HOME/.bashrc
break
fi
done
else
echo "Ngrok already installed"
fi