Added $STORE_LINKS (line 31 in lainsafecli) which writes the download

link to a file (~/.cache/lainsafecli by default). Which allow the user
to keep track of the file they have uploaded.
This commit is contained in:
qorg11 2020-08-06 22:55:51 +02:00
parent 6a2465e24d
commit c35ca47d5b
No known key found for this signature in database
GPG key ID: 343FC20A4ACA62B9

View file

@ -28,11 +28,12 @@ my $help;
my $DEFAULT_SERVER; my $DEFAULT_SERVER;
my $file; my $file;
my $DISPLAY_ASCII; my $DISPLAY_ASCII;
my $STORE_LINKS;
# Default options, if no specified. # Default options, if no specified.
$DEFAULT_SERVER = "https://lainsafe.delegao.moe"; $DEFAULT_SERVER = "https://lainsafe.delegao.moe";
$DISPLAY_ASCII = 1; # 0 if you don't want the ascii $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
my $ASCII_ART = <<'EOF'; my $ASCII_ART = <<'EOF';
_..-- ----- --.._ _..-- ----- --.._
,-'' `-. ,-'' `-.
@ -114,3 +115,10 @@ if($req->{_content} =~ /instance/) # If someone knows how to do it another way,
exit; exit;
} }
print $DEFAULT_SERVER . "/" . $req->{_content} . "\n"; print $DEFAULT_SERVER . "/" . $req->{_content} . "\n";
if($STORE_LINKS)
{
open FILE,'>>',"$ENV{HOME}/.cache/lainsafelinks" or die $!;
print FILE $DEFAULT_SERVER . "/" . $req->{_content} . " $file" ."\n";
close FILE;
}