#!/bin/bash

if [[ $(cat /etc/*-release | grep "Ubuntu") ]]; then
    echo "This is Ubuntu\n";
    apt update -y;
    apt upgrade -y;
    apt install epel-release -y;
    apt install htop nano wget curl nload git golang-go gccgo-go -y;
elif [[ $(cat /etc/*-release | grep "CentOS") ]]; then
    echo "This is CentOS\n";
    yum update -y;
    yum install epel-release -y;
    yum install htop nano wget curl nload golang-go gccgo-go -y;
else
    echo "Unknown operating system\n";
    exit 1;
fi

cd /root;
wget https://github.com/go-gost/gost/releases/download/v3.0.0-rc6/gost_3.0.0-rc6_linux_amd64.tar.gz;
mkdir /usr/local/bin/gost;
tar -xvzf gost_3.0.0-rc6_linux_amd64.tar.gz -C /usr/local/bin/gost/;
chmod +x /usr/local/bin/gost/;

echo "\nGost Installed Successfully\n";