summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-15 09:50:13 -0600
committerJeff Carr <[email protected]>2024-11-15 09:50:13 -0600
commitea96d4880eedd92d9c8228b84de028185ec941b2 (patch)
tree8c8f317c1ddca756e7c1bc12c132855e6d32833c /main.go
parent7b069233955c6f35270f0cb2cb49bf6038c11020 (diff)
does apt_linux.go vs apt_windows.go work automagically?
Diffstat (limited to 'main.go')
-rw-r--r--main.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/main.go b/main.go
index ab7717c..3368042 100644
--- a/main.go
+++ b/main.go
@@ -55,6 +55,31 @@ func main() {
for pkg, version := range installedPackages {
fmt.Printf("%s: %s\n", pkg, version)
}
+
+ // Detect the Linux distribution
+ distro := detectDistro()
+ if distro == "" {
+ fmt.Println("Unable to detect Linux distribution.")
+ return
+ }
+
+ fmt.Printf("Detected distribution: %s\n", distro)
+
+ // Get the list of installed packages for the detected distro
+ packages, err := getPackageList(distro)
+ if err != nil {
+ fmt.Println("Error:", err)
+ return
+ }
+
+ // Print the installed packages
+ fmt.Println("Installed Packages:")
+ for _, pkg := range packages {
+ if pkg != "" {
+ fmt.Println(pkg)
+ }
+ }
+
go NewWatchdog()
startHTTP()