Added $LINK_STORE so the user can choose where to store the upload

links. Closes #9
This commit is contained in:
qorg11 2020-08-07 19:27:57 +02:00
parent 95ab4caca1
commit 97e5c795e7
No known key found for this signature in database
GPG Key ID: 343FC20A4ACA62B9
2 changed files with 6 additions and 4 deletions

View File

@ -1,2 +1,2 @@
* set $MAX_SIZE variable in upload.cgi
* echo links in .cache/lainsafelinks in lainsafecli
[x] set $MAX_SIZE variable in upload.cgi
[x] echo links in .cache/lainsafelinks in lainsafecli

View File

@ -29,11 +29,13 @@ my $DEFAULT_SERVER;
my $file;
my $DISPLAY_ASCII;
my $STORE_LINKS;
my $LINKS_FILE;
# Default options, if no specified.
$DEFAULT_SERVER = "https://lainsafe.delegao.moe";
$DISPLAY_ASCII = 1; # 0 if you don't want the ascii
$STORE_LINKS = 1; # 0 if you don't want to keep track of your upload
$LINKS_FILE = "$ENV{HOME}/.lainsafelinks";
my $ASCII_ART = <<'EOF';
_..-- ----- --.._
,-'' `-.
@ -116,7 +118,7 @@ print $DEFAULT_SERVER . "/" . $req->{_content} . "\n";
if($STORE_LINKS)
{
open FILE,'>>',"$ENV{HOME}/.cache/lainsafelinks" or die $!;
open FILE,'>>',$LINKS_FILE or die $!;
print FILE $DEFAULT_SERVER . "/" . $req->{_content} . " $file" ."\n";
close FILE;
}