From afce0dd00ae818bf3a5a887bc9571d0fa1983318 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 1 Aug 2015 00:53:11 +0200 Subject: arping.inc - multiple improvements plus code style fixes --- config/arping/arping.inc | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'config/arping') diff --git a/config/arping/arping.inc b/config/arping/arping.inc index 0054adf0..996fddf3 100644 --- a/config/arping/arping.inc +++ b/config/arping/arping.inc @@ -1,9 +1,9 @@
"; + $int_count = (is_numeric($_POST['count']) ? (abs(intval($_POST['count']))) : 3); + $arping_options = " -v -c {$int_count}"; + if (!empty($_POST['interface'])) { + $iface = convert_friendly_interface_to_real_interface_name($_POST['interface']); + $arping_options .= " -i {$iface}"; + } + if (is_ipaddr($_POST['pinghost']) || is_hostname($_POST['pinghost']) || is_macaddr($_POST['pinghost'])) { + $arping_options .= " " . $_POST['pinghost']; + echo "arping {$arping_options} output:

"; + system("/usr/local/sbin/arping {$arping_options}"); + echo "{$button}"; + } else { + echo "
ERROR: Invalid input. Supplied address must be a valid hostname, IP or MAC address.
"; + echo "{$button}"; + } exit; } - -function arping_package_resync() { -} - -?> \ No newline at end of file +?> -- cgit v1.2.3