From a91ba2ac596339e792076aedc8c80744e852212d Mon Sep 17 00:00:00 2001 From: Pecusx Date: Wed, 9 Nov 2016 20:58:55 +0100 Subject: [PATCH] New config option - select remote controller. --- html/changeconf.php | 25 +++++++++++++++++++++++++ html/hconfig.php | 27 +++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/html/changeconf.php b/html/changeconf.php index baf5d54..27a42f1 100755 --- a/html/changeconf.php +++ b/html/changeconf.php @@ -35,6 +35,31 @@ if (isset($msg)) { echo "\r\n"; } elseif ($msg == "audio") { echo "Not implemented..."; + } elseif ($msg == "remote") { + $selected = $_POST['remote']; + if (isset($selected)) { + $remote = file_get_contents( "/usr/share/radio/hardware/remotes/".$selected ); + preg_match('/\n# *brand: *.*/', $remote, $matches); + $remotename = preg_replace("/\n# *brand: */", "", $matches[0]); + echo "Selected ".$remotename." remote controller.
\r\n"; + $end = shell_exec('sudo ./scripts/set_remote.sh '.$selected ); + echo "Reboot in progress.
\r\n"; + echo "Wait!
\r\n"; + echo "\r\n"; + } else { + echo "Remote controller not selected.
\r\n"; + echo "\r\n"; + } } elseif ($msg == "stations") { echo "Not implemented..."; } elseif ($msg == "network") { diff --git a/html/hconfig.php b/html/hconfig.php index d3d51e7..485fb14 100644 --- a/html/hconfig.php +++ b/html/hconfig.php @@ -18,6 +18,33 @@ Audio device config

+Remote config
+
+
+ ".$remotename."\n";
+	}
+}
+?>
+
+
+
+
Update to last build from github