control/controlclient: report whether we're in a snap package

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/2523/head
Brad Fitzpatrick 3 years ago committed by Denton Gentry
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…
Cancel
Save