feat: require superuser privileges
This commit is contained in:
parent
b4ed8b4af6
commit
718e6f12cc
1 changed files with 10 additions and 0 deletions
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"os/user"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"git.aliberksandikci.com.tr/Liderahenk/ahenk-go/pkg/utils"
|
"git.aliberksandikci.com.tr/Liderahenk/ahenk-go/pkg/utils"
|
||||||
|
@ -64,6 +65,15 @@ func main() {
|
||||||
} else {
|
} else {
|
||||||
panic("Please enter a valid option !")
|
panic("Please enter a valid option !")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
current, err := user.Current()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if current.Uid != "0" {
|
||||||
|
log.Fatal("Ahenk-go requires superuser privilege")
|
||||||
|
}
|
||||||
|
|
||||||
PluginManager()
|
PluginManager()
|
||||||
// NEXT Make PluginManager async !
|
// NEXT Make PluginManager async !
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue