mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
Create ping.php
ping.php file is created to perform "ping" functions
This commit is contained in:
35
front/php/server/ping.php
Normal file
35
front/php/server/ping.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
###################################################################################
|
||||
# Pi.Alert #
|
||||
# Open Source Network Guard / WIFI & LAN intrusion detector #
|
||||
# #
|
||||
# sping.php # Front module. Server side. System Information #
|
||||
###################################################################################
|
||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 #
|
||||
# jokob#sk 2022 jokob.sk@gmail.com GNU GPLv3 #
|
||||
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
|
||||
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
|
||||
###################################################################################
|
||||
|
||||
// Get init.php
|
||||
require dirname(__FILE__).'/../server/init.php';
|
||||
|
||||
// Get IP
|
||||
$ip = $_GET['ip'];
|
||||
|
||||
// Check if IP is valid
|
||||
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
|
||||
echo '' . lang('DevDetail_Tools_Ping_Error') . '';
|
||||
exit;
|
||||
}
|
||||
|
||||
// Perform a test with the PING command
|
||||
$output = shell_exec("ping #c4 $ip");
|
||||
|
||||
// Show the result
|
||||
echo "<pre>";
|
||||
echo $output;
|
||||
echo "</pre>";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user