Files
BarangaySystem/scripts/tunnel.sh
2026-06-06 18:43:00 +08:00

24 lines
862 B
Bash
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Cloudflare Tunnel Script for BukidBounty App
# This script uses Docker to create a temporary Cloudflare tunnel for port 9522
echo "🚀 Starting Cloudflare Tunnel for localhost:9522..."
echo "----------------------------------------------------"
# Check if Docker is installed
if ! command -v docker &> /dev/null
then
echo "❌ Error: Docker is not installed. Please install Docker to run this tunnel."
exit 1
fi
# Check if a token was provided as an argument
if [ -z "$1" ]; then
echo " No token provided. Creating a temporary 'trycloudflare.com' tunnel..."
docker run --rm -it --network host cloudflare/cloudflared tunnel --url http://localhost:9522
else
echo " Using provided Cloudflare Tunnel token..."
docker run --rm -it --network host cloudflare/cloudflared tunnel --no-autoupdate run --token "$1"
fi