Bestanden uploaden naar 'scripts'

This commit is contained in:
2019-06-05 22:04:55 +00:00
parent a386bd1e70
commit 710979bda9
5 changed files with 337 additions and 0 deletions

107
scripts/check-nas.php Normal file
View File

@@ -0,0 +1,107 @@
<html>
<head>
<meta charset="utf-8">
<title>Foto importeer app</title>
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="milligram.min.css">
<script src="sweetalert.min.js"></script>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#content {
margin: 0px auto;
text-align: center;
}
h2 {
letter-spacing: 3px;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 1%;
margin-bottom: 1%;
}
.vl {
border-top: 1px solid #9b4dca;
padding-top: 10px;
padding-bottom: 15px;
}
.colcontent {
display: none;
overflow: hidden;
}
button.collapsible {
margin-bottom: 26px;
}
.collapsible {
width: 180px;
}
</style>
</head>
<body>
<body>
<div id="content">
<img src="tokyo-taxi.svg" height="51px" alt="Tokyo taxi">
<h2>Foto importeer app</h2>
<div class="vl"></div>
<h3>Nas Connectie probleem oplossen</h3>
<div class="vl"></div>
<h4>Stap 1: Druk op herstart<br>
Stap 2: Druk ok in de foutmelding<br>
Stap 3: Wacht 2 minuten<br>
Stap 4: Druk op herlaad
</h4>
<h4>
Mocht deze medling hier na nogmaals opkomen, neem contact op
</h4>
<form>
<form method="post">
<button class="button" name="reload">Herlaad</button>
</form>
<form method="post">
<button class="button button-outline" name="reboot">Herstart</button>
</form>
<form method="post">
<button class="button button-outline" name="shutdown">Zet uit</button>
</form>
</p>
<p><a href="sysinfo.php">System info</a></p>
</div>
<?php
$shellout = shell_exec("if grep -qs '/mnt/SMB ' /proc/mounts; then echo 1; else echo 0; fi;");
if ($shellout==1) {
header('Location: step1.php');
}
if ($shellout==0) {
echo '<script>swal("Er kan geen verbing met de nas worden gemaakt", "Druk Ok voor meer instructies", "error")</script>';
}
if (isset($_POST['shutdown']))
{
shell_exec('sudo shutdown -h 1');
echo '<script>swal(" ",{title:"De importeer tool word uitgeschakeld",icon: "info",button: false,});</script>';
}
if (isset($_POST['reboot']))
{
shell_exec('sudo shutdown -r 1');
header('Location: check-nas.php');
}
if (isset($_POST['reload']))
{
header('Location: check-nas.php');
}
?>
</body>
</html>

62
scripts/error-import.php Normal file
View File

@@ -0,0 +1,62 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Foto importeer tool</title>
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="milligram.min.css">
<script src="sweetalert.min.js"></script>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#content {
margin: 0px auto;
text-align: center;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 1%;
margin-bottom: 1%;
}
.vl {
border-top: 1px solid #9b4dca;
padding-top: 10px;
padding-bottom: 15px;
}
h4.h4txt {
padding-bottom: 26px;
margin: 0px;
}
</style>
</head>
<body>
<script>
swal("Er is iets fout gegaan tijdens het importeren", "", "error")
</script>
<div id="content">
<img src="tokyo-taxi.svg" height="51px" alt="Tokyo taxi">
<h1>Foto importeer tool</h1>
<div class="vl"></div>
<h3>Er is iets fout gegaan tijdens het importeren</h3>
<div class="vl"></div>
<h4 class="h4txt">Error wil be here</h4>
<div class="vl"></div>
<p class="left">Importeer tool uitzetten</p>
<p>
<form method="post">
<button class="button button-outline" name="shutdown">Zet uit</button>
</form>
</p>
<p><a href="sysinfo.php">System info</a></p>
</div>
<?php
if (isset($_POST['shutdown']))
{
shell_exec('sudo shutdown -h 1');
echo '<script>swal(" ",{title:"De importeer tool word uitgeschakeld",icon: "info",button: false,});</script>';
}
?>
</body>
</html>

25
scripts/index.php Normal file
View File

@@ -0,0 +1,25 @@
/*
#state 0 = not running
#state 1 = now running
#state 2 = Finished without errors
#state 3 = Finished with errors
*/
<?php
$shellout = shell_exec("bash -c 'source session-state; echo \$curstate'");
if ($shellout==0) {
header('Location: check-nas.php');
}
if ($shellout==1) {
header('Location: loader-import.php');;
}
if ($shellout==2) {
header('Location: success-import.php');;
}
if ($shellout==3) {
header('Location: error-import.php');;
}
?>

86
scripts/loader-import.php Normal file
View File

@@ -0,0 +1,86 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Foto importeer app</title>
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="milligram.min.css">
<script src="sweetalert.min.js"></script>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#content {
margin: 0px auto;
text-align: center;
}
h2 {
letter-spacing: 3px;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 1%;
margin-bottom: 1%;
}
.vl {
border-top: 1px solid #9b4dca;
padding-top: 10px;
padding-bottom: 15px;
}
.colcontent {
display: none;
overflow: hidden;
}
button.collapsible {
margin-bottom: 26px;
}
.collapsible {
width: 180px;
}
.loader {
margin: 25 auto;
border: 20px solid #9b4dca;
border-radius: 50%;
border-top: 20px solid #606c76;
width: 200px;
height: 200px;
-webkit-animation: spin 1.30s linear infinite; /* Safari */
animation: spin 1.30s linear infinite;
}
/* Safari */
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
h4.h4txt {
padding-bottom: 26px;
margin: 0px;
}
.spacer {
padding-bottom: 25px;
}
</style>
</head>
<body>
<div id="content">
<img src="tokyo-taxi.svg" height="51px" alt="Tokyo taxi">
<h2>Foto importeer app</h2>
<div class="vl"></div>
<h3>Foto&#39;s worden geimporteerd</h3>
<div class="vl"></div>
<div class="loader"></div>
<div class="spacer"></div>
<div class="vl"></div>
<h4>Sluit de app.<br>Wacht ongeveer 5 minuten.<br>Heropen vervolgens de app om de status van de taak te contoleren.</h4><h4 class="h4txt">Blijf deze stappen herhalen tot de volgende pagina vershijnt.</h4>
<div class="vl"></div>
<p><a href="sysinfo.php">System info</a></p>
</body>
</html>

View File

@@ -0,0 +1,57 @@
<html lang="en">
<!-- Author: Dmitri Popov, dmpop@linux.com
License: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt -->
<head>
<meta charset="utf-8">
<title>Foto importeer tool</title>
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="milligram.min.css">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#content {
margin: 0px auto;
text-align: center;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 1%;
margin-bottom: 1%;
}
.vl {
border-top: 1px solid #9b4dca;
padding-top: 10px;
padding-bottom: 15px;
}
</style>
</head>
<body>
<div id="content">
<img src="tokyo-taxi.svg" height="51px" alt="Tokyo taxi">
<h1>Foto importeer tool</h1>
<div class="vl"></div>
<h3>Show execution log</h3>
<div class="vl"></div>
<div style="display: inline-block; text-align: left; padding-right: 10px; padding-left: 10px; padding-bottom: 26px;">
<?php
$fh = fopen("session-exec-log", 'r');
$pageText = fread($fh, 25000);
echo nl2br($pageText);
?>
</div>
<div class="vl"></div>
<form>
<input type="button" onClick="history.go(0)" value="Refresh">
</form>
<form>
<input type="button" class="button button-outline" value="Go back" onClick="window.history.back();">
</form>
</body>
</html>