package main import( "fmt" "os" ) func instDepsUbuntu() { fmt.Printf("\033[1;32mInstalling Python dependencies and OpenSSL from Ubuntu repo\033[0m\n") ExecSystem("/usr/bin/apt install -y python3-pymongo python3-psutil openssl") } func instDepsDebian() { fmt.Printf("\033[1;32mInstalling Python dependencies and OpenSSL from Debian repo\033[0m\n") ExecSystem("/usr/bin/apt install -y python3-pymongo python3-psutil openssl") } func instDepsFedora() { fmt.Printf("\033[1;32mInstalling Python dependencies and OpenSSL from Fedora repo\033[0m\n") ExecSystem("/usr/bin/dnf install -y python3-pymongo python3-psutil openssl") } func instDepsRedHat() { fmt.Printf("\033[1;32mInstalling Python dependencies and OpenSSL\033[0m\n") ExecSystem("/usr/bin/dnf install -y python3-pymongo python3-psutil openssl") } func instDepsOpenSUSE() { fmt.Printf("\033[1;32mInstalling Python dependencies and OpenSSL\033[0m\n") ExecSystem("/usr/bin/zypper install -y python3-pymongo python3-psutil openssl") } func instDockerUbuntu() { fmt.Printf("\033[1;32mInstalling Docker CE from official repo\033[0m\n") docker_install := ` apt update install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc chmod a+r /etc/apt/keyrings/docker.asc echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ tee /etc/apt/sources.list.d/docker.list > /dev/null apt update apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin` ExecSystem(docker_install) } func instDockerDebian() { fmt.Println() } func instDockerFedora() { fmt.Println() } func instDockerRedHat() { fmt.Println() } func instDockerOpenSUSE() { fmt.Println() } func instDeps() { if getDistro() == "ubuntu" { instDepsUbuntu() instDockerUbuntu() } else if getDistro() == "debian" { instDepsDebian() instDockerDebian() } else if getDistro() == "fedora" { instDepsFedora() instDockerFedora() } else if getDistro() == "redhat" { instDepsRedHat() instDockerRedHat() } else if getDistro() == "opensuse" { instDepsOpenSUSE() instDockerOpenSUSE() } else { fmt.Println("OS not supported") os.Exit(3) } }