diff --git a/cmd/packets/main.go b/cmd/packets/main.go index 726eed2..68a2700 100644 --- a/cmd/packets/main.go +++ b/cmd/packets/main.go @@ -20,6 +20,7 @@ import ( "packets/internal" "path" "path/filepath" + "runtime" "strconv" "strings" "syscall" @@ -365,6 +366,13 @@ var upgradeCmd = &cobra.Command{ func main() { + if runtime.GOOS == "linux" { + if os.Geteuid() != 0 { + fmt.Println("Please run packets as root\nThis can change in future versions but currently it is required.") + return + } + } + // ABOUT CONFIG.TOML PacketsDir = internal.PacketsPackageDir() _, err := os.Stat(filepath.Join(PacketsDir, "config.toml"))