summaryrefslogtreecommitdiff
path: root/scripts/vyatta-validate-type.pl
blob: 318572c1279d52590dd29b0a4189881a519258a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl

use strict;
use lib "/opt/vyatta/share/perl5/";
use VyattaTypeChecker;

# validate a value of a specific type
if ($#ARGV != 1) {
  print "usage: vyatta-validate-type.pl <type> <value>\n";
  exit 1;
}

exit 0 if (VyattaTypeChecker::validateType($ARGV[0], $ARGV[1]));
exit 1;