chore: initial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
function wakeOnLan($macAddress) {
|
||||
$output = shell_exec("wakeonlan " . escapeshellarg($macAddress));
|
||||
if ($output === null) {
|
||||
return "Failed to send Magic Packet.";
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$macAddress = $_POST['target'];
|
||||
$result = wakeOnLan($macAddress);
|
||||
if ($result === true) {
|
||||
$message = "Magic Packet sent successfully!";
|
||||
} else {
|
||||
$message = $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user