Add --webroot parameter.

This commit is contained in:
Danny Bautista 2019-06-07 14:12:51 -04:00 committed by Alex Cabal
parent c8cb8f788a
commit 8349f9268b
4 changed files with 32 additions and 11 deletions

View file

@ -1,6 +1,10 @@
<?
$longopts = array("webroot:");
$options = getopt("", $longopts);
$webRoot = $options["webroot"] ?? "/standardebooks.org";
$rssLength = 30;
$contentFiles = explode("\n", trim(shell_exec('find /standardebooks.org/www/ebooks/ -name "content.opf" | sort') ?? ''));
$contentFiles = explode("\n", trim(shell_exec('find ' . escapeshellarg($webRoot . '/www/ebooks/') . ' -name "content.opf" | sort') ?? ''));
$sortedContentFiles = array();