2024-05-15 05:56:21 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import(
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
|
|
|
func instDepsUbuntu() {
|
2024-05-16 07:42:38 +00:00
|
|
|
fmt.Printf("\033[1;32mInstalling OpenSSL from Ubuntu repo\033[0m\n")
|
|
|
|
ExecSystem("/usr/bin/apt install -y openssl")
|
2024-05-15 05:56:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func instDepsDebian() {
|
2024-05-16 07:42:38 +00:00
|
|
|
fmt.Printf("\033[1;32mInstalling OpenSSL from Debian repo\033[0m\n")
|
|
|
|
ExecSystem("/usr/bin/apt install -y openssl")
|
2024-05-15 05:56:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func instDepsFedora() {
|
2024-05-16 07:42:38 +00:00
|
|
|
fmt.Printf("\033[1;32mInstalling OpenSSL from Fedora repo\033[0m\n")
|
|
|
|
ExecSystem("/usr/bin/dnf install -y openssl")
|
2024-05-15 05:56:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func instDepsRedHat() {
|
2024-05-16 07:42:38 +00:00
|
|
|
fmt.Printf("\033[1;32mInstalling OpenSSL\033[0m\n")
|
|
|
|
ExecSystem("/usr/bin/dnf install -y openssl")
|
2024-05-15 05:56:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func instDepsOpenSUSE() {
|
2024-05-16 07:42:38 +00:00
|
|
|
fmt.Printf("\033[1;32mInstalling OpenSSL\033[0m\n")
|
|
|
|
ExecSystem("/usr/bin/zypper install -y openssl")
|
2024-05-15 06:38:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func instDockerUbuntu() {
|
2024-05-16 05:06:38 +00:00
|
|
|
fmt.Printf("\033[1;32mInstalling Docker CE from official repo\033[0m\n")
|
2024-05-15 06:38:54 +00:00
|
|
|
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`
|
|
|
|
|
2024-05-16 05:06:38 +00:00
|
|
|
ExecSystem(docker_install)
|
2024-05-15 06:38:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func instDockerDebian() {
|
|
|
|
fmt.Println()
|
|
|
|
}
|
|
|
|
|
|
|
|
func instDockerFedora() {
|
|
|
|
fmt.Println()
|
|
|
|
}
|
|
|
|
|
|
|
|
func instDockerRedHat() {
|
|
|
|
fmt.Println()
|
|
|
|
}
|
|
|
|
|
|
|
|
func instDockerOpenSUSE() {
|
|
|
|
fmt.Println()
|
2024-05-15 05:56:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func instDeps() {
|
|
|
|
if getDistro() == "ubuntu" {
|
|
|
|
instDepsUbuntu()
|
2024-05-15 06:38:54 +00:00
|
|
|
instDockerUbuntu()
|
2024-05-15 05:56:21 +00:00
|
|
|
} else if getDistro() == "debian" {
|
|
|
|
instDepsDebian()
|
2024-05-15 06:38:54 +00:00
|
|
|
instDockerDebian()
|
2024-05-15 05:56:21 +00:00
|
|
|
} else if getDistro() == "fedora" {
|
|
|
|
instDepsFedora()
|
2024-05-15 06:38:54 +00:00
|
|
|
instDockerFedora()
|
2024-05-15 05:56:21 +00:00
|
|
|
} else if getDistro() == "redhat" {
|
|
|
|
instDepsRedHat()
|
2024-05-15 06:38:54 +00:00
|
|
|
instDockerRedHat()
|
2024-05-15 05:56:21 +00:00
|
|
|
} else if getDistro() == "opensuse" {
|
|
|
|
instDepsOpenSUSE()
|
2024-05-15 06:38:54 +00:00
|
|
|
instDockerOpenSUSE()
|
2024-05-15 05:56:21 +00:00
|
|
|
} else {
|
|
|
|
fmt.Println("OS not supported")
|
|
|
|
os.Exit(3)
|
|
|
|
}
|
|
|
|
}
|