PiRadio v. ".$piradio_version."";
?>
0)
{
echo "Error: " . $_FILES["file"]["error"] . "
";
} else {
echo "File: ";
echo $_FILES["file"]["name"] ;
echo " loaded.
\r\n";
move_uploaded_file($_FILES["file"]["tmp_name"], "/tmp/piradio.stl");
$tablica = explode('.', $_FILES["file"]["name"]);
$ostatni = count($tablica);
if($tablica[$ostatni-1] == 'stl') {
$end = shell_exec('sudo ./scripts/restore_stlist.sh unpack');
if (file_exists("/tmp/radiod/config/version")) {
echo "Setting new station list.
\r\n";
$end = shell_exec('sudo ./scripts/restore_stlist.sh apply');
echo "O.K.
\r\n";
$end = shell_exec('sudo ./scripts/restart.sh');
/* UWAGA! Folder z plikami uruchamianymi przez sudo
musi byc dopisany w pliku /etc/sudoers */
echo "PiRadio restart in progress.
\r\n";
echo "Wait!
\r\n";
echo "\r\n";
} else {
echo "This is not PiRadio station list file!!!
\r\n";
echo "\r\n";
}
} else {
unlink("/tmp/piradio.stl");
echo "This is wrong file!
\r\n";
echo "\r\n";
}
}
} else {
$end = shell_exec('sudo ./scripts/make_stlist_file.sh');
echo "Backup PiRadio station list
\r\n";
echo "\r\nClick the 'Backup' button to download station list backup file to your computer.\r\n
\r\n";
echo '';
echo "
\r\n";
echo "Restore PiRadio station list
\r\n";
echo "After restoringing PiRadio will be restarted!
\r\n";
echo "\r\n";
}
?>