1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/security/security_data.go
2018-05-22 17:51:59 -07:00

38 lines
727 B
Go

package security
import (
"strings"
)
type SecurityData struct {
Dns string
FirewallEnabled string
FirewallStealth string
LoggedInUsers []string
WifiEncryption string
WifiName string
}
func NewSecurityData() *SecurityData {
return &SecurityData{}
}
func (data *SecurityData) DnsAt(idx int) string {
records := strings.Split(data.Dns, "\n")
if len(records) > 0 && len(records) > idx {
return records[idx]
} else {
return ""
}
}
func (data *SecurityData) Fetch() {
data.Dns = DnsServers()
data.FirewallEnabled = FirewallState()
data.FirewallStealth = FirewallStealthState()
data.LoggedInUsers = LoggedInUsers()
data.WifiName = WifiName()
data.WifiEncryption = WifiEncryption()
}