forked from Plemya-x/ALR
wip
This commit is contained in:
@ -17,13 +17,13 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
"os/user"
|
||||
"strconv"
|
||||
"syscall"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func GetUidGidAlrUserString() (string, string, error) {
|
||||
@ -69,9 +69,9 @@ func DropCapsToAlrUser() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExitIfNotRoot() {
|
||||
func ExitIfNotRoot() error {
|
||||
if os.Getuid() != 0 {
|
||||
slog.Error(gotext.Get("You need to be root"))
|
||||
os.Exit(1)
|
||||
return cli.Exit(gotext.Get("You need to be root to perform this action"), 1)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user