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:
parent
6a2465e24d
commit
c35ca47d5b
1 changed files with 10 additions and 2 deletions
12
lainsafecli
12
lainsafecli
|
@ -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;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue