I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
lainsafecli 4.08 KiB
#!/usr/bin/perl
# Lainsafe cli

# This file is part of lainsafe.

# lainsafe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# lainsafe is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with lainsafe.  If not, see <https://www.gnu.org/licenses/>.

use Getopt::Long;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
use strict;
use warnings;
# variables
my $help;
my $tor;
my $i2p;
my $get_response;
my $DEFAULT_SERVER;
my $file;
my $DISPLAY_ASCII;
my $STORE_LINKS;
my $LINKS_FILE;
my $proxy_enabled = 1;
# 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}/.cache/lainsafelinks";

eval "use LWP::Protocol::socks; 1" or $proxy_enabled = 0;
my $ASCII_ART = <<'EOF';
           _..-- ----- --.._
        ,-''                `-.
       ,                       \
      /                         \
     /        ` .                \
    '         /  ||               ;
    ;      ^/|   |/        |      |
    |      /v    /\`-'v√\'-|\     ,
    |   /v` ,---      ---- .^.|    ;
    :  |   /´@@`,     ,@@`\  |    ;
    '  |  '. @@ /     \@@ /  |\  |;
    | ^|    -----      ---   | \/||
    ` |`                     | /\ /
    \    \                   |/ |,
    ' ;   \                 /|  |
      `    \      --       / |  |
      `     `.          .-'  |  /
       v,-    `;._   _.;     | |
          `'`\ |-_      -^'^'| |
                  ------     |/

EOF

# Subs

sub help
  {
    print "lainsafecli, a command line interface for lainsafe.\n";