summaryrefslogtreecommitdiff
path: root/linuxloop.go
diff options
context:
space:
mode:
Diffstat (limited to 'linuxloop.go')
-rw-r--r--linuxloop.go40
1 files changed, 20 insertions, 20 deletions
diff --git a/linuxloop.go b/linuxloop.go
index c791165..41842e1 100644
--- a/linuxloop.go
+++ b/linuxloop.go
@@ -10,13 +10,13 @@
package linuxstatus
-import (
+import (
+ "io/ioutil"
"os"
"os/user"
- "io/ioutil"
+ "sort"
"strconv"
"strings"
- "sort"
"go.wit.com/log"
)
@@ -36,35 +36,35 @@ func linuxLoop() {
log.Log(CHANGE, "scanInterfaces() detected a change")
}
for i, t := range me.ifmap {
- log.Log(NET, strconv.Itoa(i) + " iface = " + t.iface.Name)
+ log.Log(NET, strconv.Itoa(i)+" iface = "+t.iface.Name)
}
// get all the real A records from all the network interfaces linux can see
a := realA()
sort.Strings(a)
tmp := strings.Join(a, "\n")
- if tmp != me.workingIPv4.Get() {
+ if tmp != me.workingIPv4.String() {
log.Log(CHANGE, "realAAAA() your real IPv6 addresses changed")
me.changed = true
- me.workingIPv4.Set(tmp)
+ me.workingIPv4.SetValue(tmp)
}
// get all the real AAAA records from all the network interfaces linux can see
aaaa := realAAAA()
sort.Strings(aaaa)
tmp = strings.Join(aaaa, "\n")
- if tmp != me.workingIPv6.Get() {
+ if tmp != me.workingIPv6.String() {
log.Log(CHANGE, "realAAAA() your real IPv6 addresses changed")
me.changed = true
- me.workingIPv6.Set(tmp)
+ me.workingIPv6.SetValue(tmp)
}
user, _ := user.Current()
tmp = user.Username + " (" + strconv.Itoa(os.Getuid()) + ")"
- if tmp != me.uid.Get() {
+ if tmp != me.uid.String() {
log.Log(CHANGE, "os.Getuid =", user.Username, os.Getuid())
me.changed = true
- me.uid.Set(tmp)
+ me.uid.SetValue(tmp)
}
content, _ := ioutil.ReadFile("/etc/resolv.conf")
@@ -79,21 +79,21 @@ func linuxLoop() {
}
sort.Strings(ns)
newNS := strings.Join(ns, "\n")
- if newNS != me.resolver.Get() {
+ if newNS != me.resolver.String() {
log.Log(CHANGE, "resolver changed in /etc/resolv.conf to", ns)
me.changed = true
- me.resolver.Set(newNS)
+ me.resolver.SetValue(newNS)
}
/*
- processName := getProcessNameByPort(53)
- fmt.Println("Process with port 53:", processName)
+ processName := getProcessNameByPort(53)
+ fmt.Println("Process with port 53:", processName)
- commPath := filepath.Join("/proc", proc.Name(), "comm")
- comm, err := ioutil.ReadFile(commPath)
- if err != nil {
- return "", err // Error reading the process name
- }
- return strings.TrimSpace(string(comm)), nil
+ commPath := filepath.Join("/proc", proc.Name(), "comm")
+ comm, err := ioutil.ReadFile(commPath)
+ if err != nil {
+ return "", err // Error reading the process name
+ }
+ return strings.TrimSpace(string(comm)), nil
*/
}