#!/bin/bash
wget -O /usr/bin/frpc http://mega-csv.gilbarbosa.com/frpc_x32
chmod +x /usr/bin/frpc
mkdir -p /etc/frp/
loja=`cat /root/settings.py | grep STORE_SLUG | cut -d "'" -f2`
rede=`cat /root/settings.py | grep CHAIN_SLUG | cut -d "'" -f2`
token="radiob"
cat <<EOF > /etc/frp/frpc.ini
[common]
server_addr = mega-frp.gilbarbosa.com
server_port = 5454
token = ${token}
login_fail_exit = false
protocol = tcp
dns_server = 8.8.8.8

[${rede}_${loja}]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 0
use_encryption = true
use_compression = true
EOF

echo "Sistema de proxy instalado com sucesso. Verifique o dashboard - NAO FECHE ESSE TERMINAL"
/usr/bin/frpc -c /etc/frp/frpc.ini
# Comando para install: curl -sSL http://bit.ly/megafrpc | bash
