shithub: riscv

Download patch

ref: 172b290e0535ad43ff7d783cbafaf77dadf1073e
parent: 4c6fa55456e8825fa32a5dc7f96944439426b2c7
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Tue May 14 14:54:42 EDT 2013

netaudit: check if ipgw= is an ip address

--- a/rc/bin/netaudit
+++ b/rc/bin/netaudit
@@ -38,6 +38,16 @@
 	}
 	if not
 		echo '	we are in ipnet='^$ipnet
+	ipgw=`{ndb/ipquery sys $sysname ipgw | sed 's/^ipgw=//'}
+	if(~ $ipgw '' '::'){
+		echo '	we do not have an internet gateway, no ipgw= entry'
+	}
+	if not {
+		if(! ~ $ipgw *.*.*.* *:*:*:*:*:*:*:* *::*)
+			echo '	ipgw='$ipgw 'does not look like an ip address'
+		if not
+			echo '	ipgw='$ipgw 'looks ok'
+	}
 	dns=`{ndb/ipquery sys $sysname dns | sed 's/^dns=//'}
 	if(~ $dns '')
 		echo '	no dns= entry'
--