1 ###RUN_PERL: #!/usr/bin/perl
3 # reset is generated from reset.1.pl.
7 # Copyright (C) 2016 - 2018, 2023 Balthasar SzczepaĆski
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU Affero General Public License as
11 # published by the Free Software Foundation, either version 3 of the
12 # License, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Affero General Public License for more details.
19 # You should have received a copy of the GNU Affero General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 ###PERL_LIB: use lib /botm/lib/bsta
25 use bsta_lib qw(writedatafile);
27 ###PERL_CGI_PATH: CGI_PATH = /bsta/
29 ###PERL_DATA_CHAT_PATH: DATA_CHAT_PATH = /botm/data/bsta/chat
30 ###PERL_DATA_STATE_PATH: DATA_STATE_PATH = /botm/data/bsta/state
31 ###PERL_DATA_STORY_PATH: DATA_STORY_PATH = /botm/data/bsta/story
33 ###PERL_WWW_INDEX_PATH: WWW_INDEX_PATH = /botm/www/1190/bsta/index.htm
35 ###PERL_WEBSITE: WEBSITE = 1190.bicyclesonthemoon.info
37 ###PERL_COIN_DATE: COIN_DATE = 13-Nov-2016 22:15
38 ###PERL_INTF_DATE: INTF_DATE = 28-Sep-2016 20:34
43 'lastip' => '0.0.0.0',
63 delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
64 ###PERL_SET_PATH: $ENV{'PATH'} = /usr/local/bin:/usr/bin:/bin;
66 writedatafile(DATA_STATE_PATH,%state);
67 writedatafile(DATA_STORY_PATH,%story);
68 writedatafile(DATA_CHAT_PATH,%chat);
70 writeindex(WWW_INDEX_PATH);
72 #function borrowed from 2words.pl - keep consistent!
79 $indexfile=$indexpath;
80 unless (seek($indexfile, 0, 0)) {
85 unless (open ($indexfile, ">", $indexpath)) {
93 print $indexfile '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'."\n";
94 print $indexfile '<html>'."\n";
95 print $indexfile ' <head>'."\n";
96 print $indexfile ' <title>Index of '.$indexof.'</title>'."\n";
97 print $indexfile ' </head>'."\n";
98 print $indexfile ' <body>'."\n";
99 print $indexfile '<h1>Index of '.$indexof.'</h1>'."\n";
100 print $indexfile '<table><tr><th><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr><tr><th colspan="5"><hr></th></tr>'."\n";
101 print $indexfile '<tr><td valign="top"><img src="/icons/back.gif" alt="[DIR]"></td><td><a href="/">Parent Directory</a></td><td> </td><td align="right"> - </td><td> </td></tr>'."\n";
102 print $indexfile '<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="2words/">2words/</a></td><td align="right">'.INTF_DATE.' </td><td align="right"> - </td><td> </td></tr>'."\n";
103 print $indexfile '<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="coin/">coin/</a></td><td align="right">'.COIN_DATE.' </td><td align="right"> - </td><td> Coincidence </td></tr>'."\n";
104 print $indexfile '<tr><th colspan="5"><hr></th></tr>'."\n";
105 print $indexfile '</table>'."\n";
106 print $indexfile '<address>Apache/2.2.22 (Debian) Server at '.WEBSITE.' Port 80</address>'."\n";
107 print $indexfile '</body></html>'."\n";
110 unless (ref($indexpath)) {
114 truncate ($indexfile , tell($indexfile));