From 75dea09cfb0fe993931b0b20bf87935ce48719bf Mon Sep 17 00:00:00 2001 From: Pecusx Date: Sat, 14 Oct 2017 23:27:19 +0200 Subject: [PATCH] Raspberry Pi update option added. --- html/changeconf.php | 48 +++++++++++++++++++++++++++++++++++++++------ html/hconfig.php | 32 ++++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 8 deletions(-) diff --git a/html/changeconf.php b/html/changeconf.php index 1479833..afcf3c7 100755 --- a/html/changeconf.php +++ b/html/changeconf.php @@ -38,10 +38,10 @@ if (isset($msg)) { echo "Clear logs and caches.
\r\n"; echo "Wait!
\r\n"; echo "\r\n"; } elseif ($msg == "audio") { $selected = $_POST['output']; @@ -171,7 +171,7 @@ if (isset($msg)) { file_put_contents('/var/lib/radiod/stationlist_new', $stations); chmod("/var/lib/radiod/stationlist_new", 0755); echo "\r\n"; - echo '
'; + echo ""; echo "\r\n"; echo ''; echo "\r\n"; @@ -188,7 +188,7 @@ if (isset($msg)) { file_put_contents('/var/lib/radiod/stationlist_new', $stations); chmod("/var/lib/radiod/stationlist_new", 0755); echo "\r\n"; - echo ''; + echo ""; echo "\r\n"; echo ''; echo "\r\n"; @@ -237,13 +237,12 @@ if (isset($msg)) { $share_string = 'mount.cifs -o user="'.$login.'",password="'.$password.'",ro "'.$media_link.'" /share'; } } - echo $end; echo "New network media folder configuration.\r\n"; echo "
Network path: ".$media_link."\r\n";
 			echo "Login: ".$login."\r\n";
 			echo "Password: ".$password."\r\n";
 			echo "Shell command: ".$share_string."
\r\n"; - echo ''; + echo ""; echo "\r\n"; echo "
\r\n"; echo ""; @@ -358,6 +357,43 @@ if (isset($msg)) { echo "Proxy: ".$pandora_array['control_proxy']."
"; file_put_contents('/home/pi/.config/pianobar/config', $pandora_new); chmod("/home/pi/.config/pianobar/config", 0755); + } elseif ($msg == "rpi_update") { + $option = $_POST['submit']; + if ($option == "confirm") { + echo "Raspberry Pi update.\r\n"; + echo "
Warning!
"; + echo "This is Raspberry Pi system update.
"; + echo "The update procedure may take more than 10 minutes.
"; + echo "Do not turn off the PiRadio until a full restart.

"; + echo "If you want to track the process, cancel update now.
"; + echo "Login to your Raspberry pi via ssh and run command:

"; + echo "sudo apt-get update && sudo apt-get -y dist-upgrade

"; + echo ""; + echo "\r\n"; + echo "
\r\n"; + echo ""; + echo "\r\n"; + echo ""; + echo "\r\n"; + } elseif ($option == "ok") { + echo "Raspberry Pi update.
\r\n"; + echo "Wait!
\r\n"; + $end = shell_exec('sudo ./scripts/rpi_system_update.sh'); + echo "\r\n"; + } elseif ($option == "no") { + echo "Raspberry Pi update canceled.\r\n"; + echo "\r\n"; + } } } ?> diff --git a/html/hconfig.php b/html/hconfig.php index 3aa06b0..c6fc1f6 100644 --- a/html/hconfig.php +++ b/html/hconfig.php @@ -88,11 +88,39 @@ for ($i = 0; $i < count($remoteconfigs); $i++) {

-Update to last build from github +Update to last build from github
+
+".$local_version.". Last commit: ".date("d.m.Y H:i:s",$local_version_date).".";
+?>
+
+

Maintenance
- +
+";
+echo "free: ".round($system_free,2)." MB (".$values[4]." used)
"; +?> +

+"; +?> +