mirror of
https://github.com/sigmasternchen/PiSwitch
synced 2025-03-16 00:19:02 +00:00
and god created loops.
This commit is contained in:
parent
95a1873ad8
commit
82c3a4bc3c
1 changed files with 12 additions and 46 deletions
58
switch.php
58
switch.php
|
@ -10,53 +10,19 @@ include 'config.php';
|
||||||
include 'name.php';
|
include 'name.php';
|
||||||
header("Content-Type: text/html; charset=UTF-8");
|
header("Content-Type: text/html; charset=UTF-8");
|
||||||
|
|
||||||
if(isset($_POST['sent11'])){
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 1 1');
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 1 1');
|
|
||||||
shell_exec('sudo script/11.sh');
|
|
||||||
echo "<script type='text/javascript'>alert('$name1 angeschalten');</script>";
|
|
||||||
echo "<script type='text/javascript'>window.location.href='index.php';</script>";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($_POST['sent10'])){
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 1 0');
|
foreach($_GET as $key in $value) {
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 1 0');
|
if (substr($key, 0, 4) != "sent")
|
||||||
shell_exec('sudo script/10.sh');
|
continue;
|
||||||
echo "<script type='text/javascript'>alert('$name1 ausgeschalten');</script>";
|
$num = substr($key, 3, 1);
|
||||||
echo "<script type='text/javascript'>window.location.href='index.php';</script>";
|
$state = substr($key, 4, 1);
|
||||||
|
shell_exec($path . '/send ' . $code . ' ' . $num . ' ' . $state);
|
||||||
|
shell_exec('./script/regenerate.sh ' . $num . $state);
|
||||||
|
echo "<script type='text/javascript'>";
|
||||||
|
echo "alert('$name1 angeschalten');";
|
||||||
|
echo "window.location.href='index.php';";
|
||||||
|
echo "</script>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['sent21'])){
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 2 1');
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 2 1');
|
|
||||||
shell_exec('sudo script/21.sh');
|
|
||||||
echo "<script type='text/javascript'>alert('$name2 angeschalten');</script>";
|
|
||||||
echo "<script type='text/javascript'>window.location.href='index.php';</script>";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($_POST['sent20'])){
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 2 0');
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 2 0');
|
|
||||||
shell_exec('sudo script/20.sh');
|
|
||||||
echo "<script type='text/javascript'>alert('$name2 ausgeschalten');</script>";
|
|
||||||
echo "<script type='text/javascript'>window.location.href='index.php';</script>";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($_POST['sent31'])){
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 3 1');
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 3 1');
|
|
||||||
shell_exec('sudo script/31.sh');
|
|
||||||
echo "<script type='text/javascript'>alert('$name3 angeschalten');</script>";
|
|
||||||
echo "<script type='text/javascript'>window.location.href='index.php';</script>";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($_POST['sent30'])){
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 3 0');
|
|
||||||
shell_exec('sudo '.$path.'/./send '.$code.' 3 0');
|
|
||||||
shell_exec('sudo script/30.sh');
|
|
||||||
echo "<script type='text/javascript'>alert('$name3 ausgeschalten');</script>";
|
|
||||||
echo "<script type='text/javascript'>window.location.href='index.php';</script>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue