#!/bin/sh
# Proxy Exchange - phat node. Token o helmet369.io.vn (tab "Treo node").
DIR=$(dirname "$0")
GW="wss://tunnel.helmet369.io.vn/tunnel"
TOK="$1"
[ -z "$TOK" ] && [ -f "$DIR/token.txt" ] && TOK=$(cat "$DIR/token.txt")
if [ -z "$TOK" ]; then printf "Dan node token: "; read TOK; fi
[ -z "$TOK" ] && { echo "Chua co token. Lay o tab Treo node."; exit 1; }
echo "$TOK" > "$DIR/token.txt"
echo "Chay node = chia se bang thong Internet. Ctrl+C de dung."
exec "$DIR/proxy-node" --gateway="$GW" --yes --token="$TOK"
