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

Skip to content
Snippets Groups Projects
Unverified Commit 1b8373f0 authored by xalloc xzal's avatar xalloc xzal
Browse files

--file not needed anymore, cleaned up code in lainsafecli and upload.cgi

parent 3a541515
No related branches found
No related tags found
No related merge requests found
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
# along with lainsafe. If not, see <https://www.gnu.org/licenses/>. # along with lainsafe. If not, see <https://www.gnu.org/licenses/>.
use CGI; use CGI;
use Digest::MD5 qw(md5_hex);
my $q = CGI->new; my $q = CGI->new;
print $q->header(); print $q->header();
......
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
use Getopt::Long; use Getopt::Long;
use LWP::UserAgent; use LWP::UserAgent;
use Data::Dumper;
use Try::Tiny;
use strict; use strict;
use warnings; use warnings;
...@@ -66,7 +64,7 @@ EOF ...@@ -66,7 +64,7 @@ EOF
sub help sub help
{ {
print "lainsafecli, a command line interface for lainsafe.\n"; print "lainsafecli, a command line interface for lainsafe.\n";
print "USAGE: lainsafecli [--server] --file=FILE\n\n"; print "USAGE: lainsafecli [--server] FILE\n\n";
print "if --server not given, $DEFAULT_SERVER is used.\n"; print "if --server not given, $DEFAULT_SERVER is used.\n";
exit; exit;
...@@ -75,15 +73,23 @@ sub help ...@@ -75,15 +73,23 @@ sub help
## PROGRAM ## PROGRAM
my $ua = LWP::UserAgent->new; my $ua = LWP::UserAgent->new;
GetOptions ("server=s" => \$DEFAULT_SERVER, GetOptions ("server=s" => \$DEFAULT_SERVER,
"file=s" => \$file, "help|" => \$help);
"help" => \$help);
&help if ($help); if($help || not defined $ARGV[0])
{
&help;
}
# check if file is given # check if file is given
$file = $ARGV[@ARGV-1];
die "File does not exist\n" if !-e $file;
die "Give a file\n" unless defined $file; die "Give a file\n" unless defined $file;
my $url_to_upload = $DEFAULT_SERVER . "/upload.cgi"; my $url_to_upload = $DEFAULT_SERVER . "/upload.cgi";
my $req; my $req;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment