pkg install -y wget
pkg install -y gawk
pkg install -y screen
pkg install -y resolv-conf
pkg install -y ca-certificates
pkg install -y proot
mkdir ~/gost && cd ~/gost
REPO="go-gost/gost"
API_URL="https://api.github.com/repos/$REPO/releases"
response=$(curl -s "$API_URL")
download_link=$(echo "$response" | grep "linux_arm64" | cut -d'"' -f 4 | head -n 2 | tail -n 1)
package_name=$(echo "$response" | grep "linux_arm64" | cut -d'"' -f 4 | head -n 1)
wget "$download_link"
tar zxvf "$package_name"
rm -f "$package_name" README* LICENSE*
cd . > config.yaml
echo 'services:' >> config.yaml
echo '  - name: service-0' >> config.yaml
echo '    addr: ":10808"' >> config.yaml
echo '    resolver: resolver-0' >> config.yaml
echo '    handler:' >> config.yaml
echo '      type: socks5' >> config.yaml
echo '      metadata:' >> config.yaml
echo '        udp: true' >> config.yaml
echo '        udpbuffersize: 4096' >> config.yaml
echo '    listener:' >> config.yaml
echo '      type: tcp' >> config.yaml
echo 'resolvers:' >> config.yaml
echo '  - name: resolver-0' >> config.yaml
echo '    nameservers:' >> config.yaml
echo '      - addr: https://dns.google/dns-query' >> config.yaml
echo '        prefer: ipv6' >> config.yaml
echo '        ttl: 5m0s' >> config.yaml
echo '        async: true' >> config.yaml
cd /data/data/com.termux/files/usr/etc/profile.d
cd . > gost.sh
echo '#!/data/data/com.termux/files/usr/bin/bash' >> gost.sh
echo 'screen -wipe' >> gost.sh
echo "screen -ls | grep Detached | cut -d. -f1 | awk '{print $1}' | xargs kill" >> gost.sh
echo "screen -dmS myscreen bash -c 'cd ~/gost && proot -b $PREFIX/etc/resolv.conf:/etc/resolv.conf -b $PREFIX/etc/tls/cert.pem:/etc/ssl/certs/ca-certificates.crt ./gost -C config.yaml'" >> gost.sh
chmod +x gost.sh
exit
 
 
Back to Top