summaryrefslogtreecommitdiff
path: root/scripts/vyatta-validate-type.pl
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-09-25 15:55:26 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2007-09-25 15:55:26 -0700
commite9a79a249cec69fc178098d2f75db9389068510a (patch)
tree0e366094b7fecd3988c243fbbb574015e0c900c8 /scripts/vyatta-validate-type.pl
downloadvyatta-cfg-upstream.tar.gz
vyatta-cfg-upstream.zip
initial import (from eureka /cli) plus new build system.upstream
Diffstat (limited to 'scripts/vyatta-validate-type.pl')
-rwxr-xr-xscripts/vyatta-validate-type.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/vyatta-validate-type.pl b/scripts/vyatta-validate-type.pl
new file mode 100755
index 0000000..318572c
--- /dev/null
+++ b/scripts/vyatta-validate-type.pl
@@ -0,0 +1,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;
+