4 # reset is generated from reset.1.pl.
9 # Copyright (C) 2016 - 2018 Balthasar SzczepaĆski
11 # This program is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Affero General Public License as
13 # published by the Free Software Foundation, either version 3 of the
14 # License, or (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU Affero General Public License for more details.
21 # You should have received a copy of the GNU Affero General Public License
22 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 use bsta_lib qw(writedatafile);
41 'lastip' => '0.0.0.0',
61 delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
64 writedatafile(STATE_PATH,%state);
65 writedatafile(STORY_PATH,%story);
66 writedatafile(CHAT_PATH,%chat);
68 writeindex(INDEX_PATH);
70 #function borrowed from 2words.pl - keep consistent!
77 $indexfile=$indexpath;
78 unless (seek($indexfile, 0, 0)) {
83 unless (open ($indexfile, ">", $indexpath)) {
91 print $indexfile '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'."\n";
92 print $indexfile '<html>'."\n";
93 print $indexfile ' <head>'."\n";
94 print $indexfile ' <title>Index of '.$indexof.'</title>'."\n";
95 print $indexfile ' </head>'."\n";
96 print $indexfile ' <body>'."\n";
97 print $indexfile '<h1>Index of '.$indexof.'</h1>'."\n";
98 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";
99 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";
100 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";
101 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";
102 print $indexfile '<tr><th colspan="5"><hr></th></tr>'."\n";
103 print $indexfile '</table>'."\n";
104 print $indexfile '<address>Apache/2.2.22 (Debian) Server at '.WEBSITE.' Port 80</address>'."\n";
105 print $indexfile '</body></html>'."\n";
108 unless (ref($indexpath)) {
112 truncate ($indexfile , tell($indexfile));