Select Git revision
clamav-weekly.sh
boot.php 1.72 KiB
<!--
- Copyright (C) 2017 Tetras Libre <contact@tetras-libre.fr>
- Author: Beniamine, David <David.Beniamine@tetras-libre.fr>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<?php
extract($_POST);
$args = escapeshellarg($mac);
if(!preg_match('/^([0-9a-f]{2}:?){6}$/',$mac)){
echo "<p>Adresse MAC invalide : ".$args."</p>";
}else{
$cmd = "../scripts/sendmac.sh";
$ip=shell_exec("$cmd $args");
if(!empty(trim($ip))){
echo "<p> Démarrage de la machine ".$args." terminé !</p>";
echo "<p>Pour vous y connecter, téléchargez ";
system("cp www/config.rdp.sample www/config.rdp");
system("echo \"full address:s:\"".$_SERVER["HTTP_HOST"]." >> config.rdp");
echo '<a href="config.rdp';
echo '">ce fichier</a> et lancez le.<br />';
echo "Cela ouvrira XRDP, il vous suffira alors d'indiquer l'adresse IP <span style='color:blue;font-weight:bold'>".$ip."</span>";
echo "et le mot de passe adéquat";
echo "</p>";
}else{
header('HTTP/1.1 500 Internal Server Error');
}
}