mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
control/controlclient: report whether we're in a snap package
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
e299300b48
commit
dfa5e38fad
@ -220,6 +220,13 @@ func packageType() string {
|
|||||||
// Using tailscaled or IPNExtension?
|
// Using tailscaled or IPNExtension?
|
||||||
exe, _ := os.Executable()
|
exe, _ := os.Executable()
|
||||||
return filepath.Base(exe)
|
return filepath.Base(exe)
|
||||||
|
case "linux":
|
||||||
|
// Report whether this is in a snap.
|
||||||
|
// See https://snapcraft.io/docs/environment-variables
|
||||||
|
// We just look at two somewhat arbitrarily.
|
||||||
|
if os.Getenv("SNAP_NAME") != "" && os.Getenv("SNAP") != "" {
|
||||||
|
return "snap"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user