-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
41 lines (34 loc) · 933 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"fmt"
"os"
"github.com/jxdv/gohard/util"
"github.com/jxdv/gohard/mods"
"github.com/jxdv/gohard/ui"
)
func main() {
service := ui.ParseArgs()
// Check for supported platform
detectedPlatform, err := util.IsLinux()
if err != nil {
fmt.Printf("Error: %v\n", err)
os.Exit(1)
}
// Check for admin privileges
isAdmin, err := util.IsAdmin()
if err != nil {
fmt.Printf("Error: %v\n", err)
os.Exit(1)
}
modules := mods.LoadModules(detectedPlatform, isAdmin, service)
if len(modules) == 0 {
/*
If no modules are loaded after initial loading & filtering
we exit the program -> there are situations when this can happen, for example:
loading ssh modules without admin privileges
*/
fmt.Println("No modules loaded! Exiting..")
os.Exit(1)
}
ui.Run(modules)
}