From e8ee27ea75b4df4f91d00c6c2741bd446694e464 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 9 Oct 2025 01:30:07 -0500 Subject: simple root check --- init.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.go b/init.go index 92965b1..4a78580 100644 --- a/init.go +++ b/init.go @@ -34,3 +34,11 @@ func InitDaemon() *zoopb.Machine { m.Save() return m } + +// returns true if you are the root user +func AreRoot() bool { + if os.Getuid() == 0 { + return true + } + return false +} -- cgit v1.2.3