From c35ca47d5baa36bea47b40149c86ec92df2b4430 Mon Sep 17 00:00:00 2001 From: qorg11 Date: Thu, 6 Aug 2020 22:55:51 +0200 Subject: [PATCH] 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. --- lainsafecli | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lainsafecli b/lainsafecli index 71aab46..ee350b0 100755 --- a/lainsafecli +++ b/lainsafecli @@ -28,11 +28,12 @@ my $help; my $DEFAULT_SERVER; my $file; my $DISPLAY_ASCII; - +my $STORE_LINKS; # 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 + my $ASCII_ART = <<'EOF'; _..-- ----- --.._ ,-'' `-. @@ -114,3 +115,10 @@ if($req->{_content} =~ /instance/) # If someone knows how to do it another way, exit; } 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; + }