intitaler commit

This commit is contained in:
Maxxi (none) 2020-05-12 21:19:43 +02:00
commit 9111d5ca84
4 changed files with 188 additions and 0 deletions

5
README.md Normal file
View File

@ -0,0 +1,5 @@
### Meine Funkdosen webseite
Zu finden unter `Server/http/funk`
Achtung mit alten passwörten

120
Server/http/funk/index.php Executable file
View File

@ -0,0 +1,120 @@
<!DOCTYPE html>
<html>
<head>
<title>jQM Complex Demo</title>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div data-role="page" id="first" data-theme="b">
<div data-role="header" data-theme="a">
<h3>Licht</h3>
</div>
<div data-role="content">
<form method="get" action="index.php">
<input type="submit" value="Licht 1 an" name="test1an">
</form>
<form method="get" action="index.php">
<input type="submit" value="Licht 1 aus" name="test1aus">
</form>
<form method="get" action="index.php">
<input type="submit" value="Licht 2 an" name="test2an">
</form>
<form method="get" action="index.php">
<input type="submit" value="Licht 2 aus" name="test2aus">
</form>
<form method="get" action="index.php">
<input type="submit" value="Licht 3 an" name="test3an">
</form>
<form method="get" action="index.php">
<input type="submit" value="Licht 3 aus" name="test3aus">
</form>
<form method="get" action="index.php">
<input type="submit" value="Alle Lichter an" name="test4an">
</form>
<form method="get" action="index.php">
<input type="submit" value="Alle Lichter aus" name="test4aus">
</form>
</div>
<?php
if(isset($_GET['test1an']))
{
#exec("sudo /home/pi/raspberry-remote/send 11010 1 1");
$connection = ssh2_connect('192.168.100.2', PASSWORD);
ssh2_auth_password($connection, 'root', 'rune');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 1 1');
}
if(isset($_GET['test1aus']))
{
#exec("sudo /home/pi/raspberry-remote/send 11010 1 0");
$connection = ssh2_connect('192.168.100.2', PASSWORD);
ssh2_auth_password($connection, 'root', 'rune');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 1 0');
}
if(isset($_GET['test2an']))
{
#exec("sudo /home/pi/raspberry-remote/send 11010 2 1");
$connection = ssh2_connect('192.168.100.2', PASSWORD);
ssh2_auth_password($connection, 'root', 'rune');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 2 1');
}
if(isset($_GET['test2aus']))
{
$connection = ssh2_connect('192.168.100.2', PASSWORD);
#exec("sudo /home/pi/raspberry-remote/send 11010 2 0");
ssh2_auth_password($connection, 'root', 'rune');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 2 0');
}
if(isset($_GET['test3an']))
{
$connection = ssh2_connect('192.168.100.2', PASSWORD);
#exec("sudo /home/pi/raspberry-remote/send 11010 3 1");
ssh2_auth_password($connection, 'root', 'rune');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 3 1');
}
if(isset($_GET['test3aus']))
{
$connection = ssh2_connect('192.168.100.2', PASSWORD);
#exec("sudo /home/pi/raspberry-remote/send 11010 3 0");
ssh2_auth_password($connection, 'root', 'rune');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 3 0');
}
if(isset($_GET['test4an']))
{
$connection = ssh2_connect('192.168.100.2', PASSWORD);
#exec("sudo /home/pi/raspberry-remote/send 11010 1 1");
#exec("sudo /home/pi/raspberry-remote/send 11010 2 1");
#exec("sudo /home/pi/raspberry-remote/send 11010 3 1");
ssh2_auth_password($connection, 'root', 'rune');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 1 1');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 2 1');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 3 1');
}
if(isset($_GET['test4aus']))
{
$connection = ssh2_connect('192.168.100.2', PASSWORD);
#exec("sudo /home/pi/raspberry-remote/send 11010 1 0");
#exec("sudo /home/pi/raspberry-remote/send 11010 2 0");
#exec("sudo /home/pi/raspberry-remote/send 11010 3 0");
ssh2_auth_password($connection, 'root', 'rune');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 1 0');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 2 0');
$stream = ssh2_exec($connection, '/home/strolch/downloads/raspberry-remote/send 11010 3 0');
}
?>
</div>
</body>
</html>

63
Server/http/index.php Executable file
View File

@ -0,0 +1,63 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>pili</title>
</head>
<body bgcolor="#000000" text="#ffdd22" link="#88aaff" alink="#ffaa00" vlink="#9999cc" style="margin:0;">
<p><font size="4">
<?php
if ($_GET["status"]== 1)
{
echo "kersti muss zur arbeit..!";
#proc_open("sudo -u strolch /srv/http/xbmc2.sh");
$connection = ssh2_connect('192.168.100.10', 22);
ssh2_auth_password($connection, 'root', 'volumio');
$stream = ssh2_exec($connection, '/root/kersti_muss_zur_arbeit.sh');
#exec("ssh root@192.168.100.10 '/root/kersti_muss_zur_arbeit.sh'");
#header('Location: http://192.168.100.3:8080');
}
elseif ($_GET["status"]== 2)
{
echo "hier passiert momentan nichts";
# shell_exec("gpio write 15 0");
}
elseif ($_GET["status"]== 3)
{
echo "neues Bild wird gemacht";
$connection = ssh2_connect('192.168.100.10', 22);
ssh2_auth_password($connection, 'strolch', 'e4y6#T');
$stream = ssh2_exec($connection, ' /home/strolch/take_picture2.sh');
echo "<img alt=\"Header\" border=\"0\" src=\"./info.jpg\">";
$filename = './info.jpg';
date_default_timezone_set('Europe/Berlin');
if (file_exists($filename)) {
echo " um: " . date ("F d Y H:i:s.", filemtime($filename));
}
}
elseif ($_GET["status"]== 4)
{
echo "hier passiert momentan nichts";
# exec("pgrep blinkie.sh", $pids);
# echo $pids;
# if(empty($pids)) {
# echo "Das Blinkie-Programm wurde gestartet!";
# exec("echo \"1\">/srv/http/status/blinkie");
# #exec("/srv/http/blinkie.sh");
# }
# else
# {
# exec("echo \"0\">/srv/http/status/blinkie");
# echo "Das Blinkie-Programm wurde beendet!";
# }
}
else
{
echo "nichts wird gemacht";
}
?>
</font>
</body>

BIN
Server/http/info.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB