mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-09-25 14:20:56 +02:00
Renamed module database into tasks
This commit is contained in:
+12
-4
@@ -9,8 +9,8 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/edgebox-iot/sysctl/internal/database"
|
||||
"github.com/edgebox-iot/sysctl/internal/diagnostics"
|
||||
"github.com/edgebox-iot/sysctl/internal/tasks"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -18,7 +18,8 @@ func main() {
|
||||
// load command line arguments
|
||||
|
||||
version := flag.Bool("version", false, "Get the version info")
|
||||
name := flag.String("name", "edgebox", "name for the service")
|
||||
db := flag.Bool("database", false, "Get database connection info")
|
||||
name := flag.String("name", "edgebox", "Name for the service")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
@@ -27,6 +28,11 @@ func main() {
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if *db {
|
||||
printDbDetails()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
log.Printf("Starting Sysctl service for %s", *name)
|
||||
|
||||
// setup signal catching
|
||||
@@ -47,8 +53,10 @@ func main() {
|
||||
}()
|
||||
|
||||
printVersion()
|
||||
|
||||
printDbDetails()
|
||||
dbQueryResult := database.PerformQuery()
|
||||
|
||||
dbQueryResult := tasks.PerformQuery()
|
||||
log.Printf("Query result: %s", dbQueryResult)
|
||||
|
||||
// infinite loop
|
||||
@@ -75,7 +83,7 @@ func printVersion() {
|
||||
func printDbDetails() {
|
||||
fmt.Printf(
|
||||
"\n\nDatabase Connection Information:\nHost: %s\nuser: %s\npassword: %s\n\n",
|
||||
database.Dbhost, database.Dbuser, database.Dbpass,
|
||||
tasks.Dbhost, tasks.Dbuser, tasks.Dbpass,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user