Created
April 9, 2022 21:22
-
-
Save arsalanses/30caeaa02e64b0f1d3414fe8657c6f37 to your computer and use it in GitHub Desktop.
A bash script to start HTop in background, and send Ngrok URL to a Telegram Bot automatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# install tmux ttyd curl torsocks jq ngrok htop | |
tmux new -d -s ttyd './ttyd.x86_64 -p 8080 -m 1 -R htop' | |
tmux split-window -h | |
tmux send-keys "./ngrok-stable-linux-amd64/ngrok http 8080 -region=ap" C-m | |
sleep 3 | |
TELEGRAM_TOKEN="" # fill here | |
TELEGRAM_ID="" # fill here | |
NGROK_URLS=$(curl -s http://127.0.0.1:4040/api/tunnels | jq '.tunnels[0].public_url') | |
torsocks curl -s --data chat_id="${TELEGRAM_ID}" --data-urlencode "text=${NGROK_URLS}" "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage?parse_mode=HTML" > telegram.log & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment