1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/security/security_data.go
2018-04-11 13:19:14 -07:00

36 lines
663 B
Go

package security
import (
"strings"
)
type SecurityData struct {
Dns string
FirewallEnabled string
FirewallStealth 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.WifiName = WifiName()
data.WifiEncryption = WifiEncryption()
}