19 lines
552 B
Bash
19 lines
552 B
Bash
# Set the target host and port
|
|
TARGET_HOST="androidnasserver1"
|
|
TARGET_PORT="80"
|
|
LOCAL_PORT="4533"
|
|
SERVEO_DOMAIN="serveo.net"
|
|
|
|
|
|
|
|
|
|
EXISTING_SSH_PID=$(pgrep -f "ssh -R 80:localhost:4533 serveo.net")
|
|
echo $EXISTING_SSH_PID
|
|
|
|
|
|
if ! [ -n "$EXISTING_SSH_PID" ]; then
|
|
# Start reverse proxy in the background
|
|
ssh -R $TARGET_HOST:$TARGET_PORT:127.0.0.1:$LOCAL_PORT $SERVEO_DOMAIN > /data/data/com.termux/files/home/.cronlog/cronlog.txt 2>&1 &
|
|
nohup caddy reverse-proxy --from :2637 --to :4533
|
|
fi
|