0e25d15d |
1 | #!/usr/bin/php5 |
4cc7f778 |
2 | <?php |
3 | /******************************************************************************** |
4 | * spoolgen.php : spool generation |
5 | * -------------- |
6 | * |
7 | * This file is part of the banana distribution |
8 | * Copyright: See COPYING files that comes with this distribution |
9 | ********************************************************************************/ |
10 | |
11 | require_once("banana/banana.inc.php"); |
12 | |
dfb752b1 |
13 | $opt = getopt('u:P:p:hfr:'); |
4cc7f778 |
14 | |
15 | if(isset($opt['h'])) { |
16 | echo <<<EOF |
dfb752b1 |
17 | usage: spoolgen.php [-h] [-f] [ -u user ] [ -p pass ] [ -P port ] [ -r spool_root ] |
4cc7f778 |
18 | create all spools, using user user and pass pass |
dfb752b1 |
19 | if -f is set, also refresh the RSS feed |
4cc7f778 |
20 | EOF; |
21 | exit; |
22 | } |
23 | |
dfb752b1 |
24 | if (!isset($opt['P'])) { |
25 | $opt['P'] = '119'; |
26 | } |
d5588318 |
27 | |
dfb752b1 |
28 | Banana::$nntp_host = "news://{$opt['u']}:{$opt['p']}@localhost:{$opt['P']}/\n"; |
29 | if (isset($opt['r'])) { |
30 | Banana::$spool_root = $opt['r']; |
31 | } |
32 | if (isset($opt['f'])) { |
33 | Banana::createAllSpool(array('NNTP')); |
34 | } else { |
35 | Banana::refreshAllFeeds(array('NNTP')); |
36 | } |
d5588318 |
37 | // vim:set et sw=4 sts=4 ts=4 |
4cc7f778 |
38 | ?> |