remove places the app could exit

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-03-28 08:53:51 -05:00
parent 91787b9121
commit dae59705a1
7 changed files with 10 additions and 62 deletions

View File

@ -53,6 +53,7 @@ func test() error {
func mainBash() {
if err := test(); err != nil {
log(logError, "exit in mainBash()")
exit(err)
}
}

View File

@ -13,7 +13,8 @@ func watchSysClassNet() {
// Create new watcher.
watcher, err := fsnotify.NewWatcher()
if err != nil {
exit(err)
log(logError, "watchSysClassNet() failed:", err)
return
}
defer watcher.Close()
@ -41,7 +42,8 @@ func watchSysClassNet() {
// Add a path.
err = watcher.Add("/tmp")
if err != nil {
exit(err)
log(logError, "watchSysClassNet() watcher.Add() failed:", err)
return
}
// Block main goroutine forever.

View File

@ -1,57 +0,0 @@
#!/bin/bash -x
## Tunnel ID: 818143
# Creation Date:Feb 12, 2023
# Description:
# IPv6 Tunnel Endpoints
# Server IPv4 Address:184.105.253.14
# Server IPv6 Address:2001:470:1f10:2a::1/64
# Client IPv4 Address:74.87.91.117
# Client IPv6 Address:2001:470:1f10:2a::2/64
# Routed IPv6 Prefixes
# Routed /64:2001:470:1f11:2a::/64
# Routed /48:Assign /48
# DNS Resolvers
# Anycast IPv6 Caching Nameserver:2001:470:20::2
# Anycast IPv4 Caching Nameserver:74.82.42.42
# DNS over HTTPS / DNS over TLS:ordns.he.net
# rDNS DelegationsEdit
# rDNS Delegated NS1:
# rDNS Delegated NS2:
# rDNS Delegated NS3:
# rDNS Delegated NS4:
# rDNS Delegated NS5:
# ifconfig sit0 up
# ifconfig sit0 inet6 tunnel ::184.105.253.14
# ifconfig sit1 up
# ifconfig sit1 inet6 add 2001:470:1f10:2a::2/64
# route -A inet6 add ::/0 dev sit1
if [ "$1" = "down" ]; then
ip tunnel del he-ipv6
rmmod sit
exit
fi
if [ "$1" = "ping" ]; then
ping -c 3 2001:470:1f10:13d::1
exit
fi
modprobe ipv6
ip tunnel add he-ipv6 mode sit remote 184.105.253.14 local 40.132.180.131 ttl 255
ip link set he-ipv6 up
ip addr add 2001:470:1f10:13d::2/64 dev he-ipv6
ip route add ::/0 dev he-ipv6
ip -f inet6 addr
ifconfig he-ipv6 mtu 1460
# old attempt from the something or pabtz hotel
# modprobe ipv6
# ip tunnel add he-ipv6 mode sit remote 184.105.253.14 local 74.87.91.117 ttl 255
# ip link set he-ipv6 up
# ip addr add 2001:470:1f10:2a::2/64 dev he-ipv6
# ip route add ::/0 dev he-ipv6
# ip -f inet6 addr

View File

@ -22,7 +22,6 @@ func getHostname() {
s, err = fqdn.FqdnHostname()
if (err != nil) {
log("FQDN hostname error =", err)
exit()
return
}
if (me.fqdn != nil) {

1
log.go
View File

@ -25,5 +25,6 @@ func sleep(a ...any) {
}
func exit(a ...any) {
log(logError, "got to log() exit")
witlog.Exit(a...)
}

View File

@ -9,7 +9,8 @@ func Example_listLink() {
// Dial a connection to the rtnetlink socket
conn, err := rtnetlink.Dial(nil)
if err != nil {
exit(err)
log(logError, "Example_listLink() failed", err)
return
}
defer conn.Close()

View File

@ -24,6 +24,7 @@ func Escalate() {
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
log(logError, "exit in Escalate()")
exit(err)
}
}
@ -45,7 +46,7 @@ func DumpPublicDNSZone(zone string) {
func dumpIPs(host string) {
ips, err := net.LookupIP(host)
if err != nil {
exit(err)
log(logError, "dumpIPs() failed:", err)
}
for _, ip := range ips {
log(host, ip)