mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(config): lxc container detection (#900)
fix(config): detection for lxc containers
This commit is contained in:
parent
bc96979907
commit
d085d894d4
1 changed files with 7 additions and 1 deletions
|
@ -107,7 +107,13 @@ func writeConfig(configPath string, configFile string) error {
|
|||
// docker creates a .dockerenv file at the root
|
||||
// of the directory tree inside the container.
|
||||
// if this file exists then the viewer is running
|
||||
// from inside a container so return true
|
||||
// from inside a docker container so return true
|
||||
host = "0.0.0.0"
|
||||
} else if _, err := os.Stat("/dev/.lxc-boot-id"); err == nil {
|
||||
// lxc creates this file containing the uuid
|
||||
// of the container in every boot.
|
||||
// if this file exists then the viewer is running
|
||||
// from inside a lxc container so return true
|
||||
host = "0.0.0.0"
|
||||
} else if pd, _ := os.Open("/proc/1/cgroup"); pd != nil {
|
||||
defer pd.Close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue