From 97e5c795e70ccce607a50be50af0cb6d1117df30 Mon Sep 17 00:00:00 2001 From: qorg11 Date: Fri, 7 Aug 2020 19:27:57 +0200 Subject: [PATCH] Added $LINK_STORE so the user can choose where to store the upload links. Closes #9 --- TODO.MD | 4 ++-- lainsafecli | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/TODO.MD b/TODO.MD index 22c0a6c..8d83e8c 100644 --- a/TODO.MD +++ b/TODO.MD @@ -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 diff --git a/lainsafecli b/lainsafecli index 4ed1213..ff8eb54 100755 --- a/lainsafecli +++ b/lainsafecli @@ -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; }