# HG changeset patch # User Pascal Bellard # Date 1431429058 -7200 # Node ID 62d49bf26410f72a3f16a91aa87e87cee8a82e32 # Parent 925a593037d36994ddc0b0fd39e7453adae24d7b network.cgi : edit arp table diff -r 925a593037d3 -r 62d49bf26410 network.cgi --- a/network.cgi Tue May 12 09:36:14 2015 +0200 +++ b/network.cgi Tue May 12 13:10:58 2015 +0200 @@ -111,6 +111,13 @@ done } +select_if() { + echo '' +} # Actions commands before page is displayed @@ -143,6 +150,12 @@ get_hostname="$(GET host)" echo $(_ 'Changed hostname: %s' $get_hostname) | log echo "$get_hostname" > /etc/hostname ;; + *\ rmarp\ *) + arp -d $(urldecode "$(GET entry)") ;; + *\ addarp\ *) + arp -i $(GET interface) -s $(GET ip) $(GET mac) ;; + *\ proxyarp\ *) + arp -i $(GET interface) -Ds $(GET ip) $(GET interface) ;; esac case " $(POST) " in @@ -644,18 +657,20 @@
-
$(_ 'Hosts')
-
$(cat /etc/hosts)
+
+ $(_ 'Hosts') EOT [ -w /etc/hosts ] && cat <
- EOT cat < +
+
$(cat /etc/hosts)
+
@@ -681,32 +696,72 @@
$(_ 'Output of ifconfig')
-
$(ifconfig)
+
$(ifconfig)
$(_ 'Routing table')
-
$(route -n)
+
$(route -n)
-
$(_ 'Domain name resolution')
-
$(cat /etc/resolv.conf)
+
+ $(_ 'Domain name resolution') +EOT + [ -w /etc/resolv.conf ] && cat < + + + +EOT + cat < +
$(cat /etc/resolv.conf)
$(_ 'ARP table')
-
$(arp)
+