mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
50 lines
1.6 KiB
PHP
Executable File
50 lines
1.6 KiB
PHP
Executable File
<?php
|
|
|
|
###################################################################################
|
|
# Pi.Alert #
|
|
# Open Source Network Guard / WIFI & LAN intrusion detector #
|
|
# #
|
|
# internetinfo.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';
|
|
|
|
// Perform a test with the PING command
|
|
$output = shell_exec("curl ipinfo.io");
|
|
|
|
// Check if there is error
|
|
if (!isset($output) || empty($output)) {
|
|
// Error message
|
|
$output = lang('DevDetail_Tab_Tool_Internet_Info_Error');
|
|
// Show the result
|
|
echo "<pre>";
|
|
echo $output;
|
|
echo "</pre>";
|
|
exit;
|
|
}
|
|
|
|
// Replace "{" with ""
|
|
$output = str_replace("{", "", $output);
|
|
|
|
// Replace "}" with ""
|
|
$output = str_replace("}", "", $output);
|
|
|
|
// Replace "," with ""
|
|
$output = str_replace(",", "", $output);
|
|
|
|
// Replace '"' with ""
|
|
$output = str_replace('"', "", $output);
|
|
|
|
// Show the result
|
|
echo "<pre>";
|
|
echo $output;
|
|
echo "</pre>";
|
|
|
|
?>
|