mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
22 lines
345 B
Go
22 lines
345 B
Go
package helper
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/spf13/cast"
|
|
)
|
|
|
|
func InNginxUIOfficialDocker() bool {
|
|
return cast.ToBool(os.Getenv("NGINX_UI_OFFICIAL_DOCKER"))
|
|
}
|
|
|
|
func DockerSocketExists() bool {
|
|
if !InNginxUIOfficialDocker() {
|
|
return false
|
|
}
|
|
_, err := os.Stat("/var/run/docker.sock")
|
|
if os.IsNotExist(err) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|