funksteckdosen/Server/http/index.php

64 lines
1.7 KiB
PHP
Executable File

<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>