45 lines
921 B
Go
45 lines
921 B
Go
|
package main
|
||
|
|
||
|
import(
|
||
|
"fmt"
|
||
|
"os/exec"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func instDepsUbuntu() {
|
||
|
fmt.Printf("\n\033[1;32mInstalling Python dependencies and OpenSSL from Ubuntu repo\033[0m\n")
|
||
|
exec.Command("/usr/bin/apt install -y python3-pymongo python3-psutil openssl")
|
||
|
}
|
||
|
|
||
|
func instDepsDebian() {
|
||
|
fmt.Println("Installing dependencies on Debian")
|
||
|
}
|
||
|
|
||
|
func instDepsFedora() {
|
||
|
fmt.Println("Installing dependencies on Fedora")
|
||
|
}
|
||
|
|
||
|
func instDepsRedHat() {
|
||
|
fmt.Println("Installing dependencies on Red Hat")
|
||
|
}
|
||
|
|
||
|
func instDepsOpenSUSE() {
|
||
|
fmt.Println("Installing dependencies on openSUSE")
|
||
|
}
|
||
|
|
||
|
func instDeps() {
|
||
|
if getDistro() == "ubuntu" {
|
||
|
instDepsUbuntu()
|
||
|
} else if getDistro() == "debian" {
|
||
|
instDepsDebian()
|
||
|
} else if getDistro() == "fedora" {
|
||
|
instDepsFedora()
|
||
|
} else if getDistro() == "redhat" {
|
||
|
instDepsRedHat()
|
||
|
} else if getDistro() == "opensuse" {
|
||
|
instDepsOpenSUSE()
|
||
|
} else {
|
||
|
fmt.Println("OS not supported")
|
||
|
os.Exit(3)
|
||
|
}
|
||
|
}
|