summaryrefslogtreecommitdiff
path: root/scripts/priority.pl
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-10-21 11:25:01 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-10-21 11:25:01 -0700
commit64a061562ffe5af7036a4caac16ef51ad1efd724 (patch)
treebd6410ceb94eb3f2ae1014ae957a0a8d6812ed1e /scripts/priority.pl
parentba979b51ca9e32ea341c1570283e7c5874fb1369 (diff)
downloadvyatta-cfg-64a061562ffe5af7036a4caac16ef51ad1efd724.tar.gz
vyatta-cfg-64a061562ffe5af7036a4caac16ef51ad1efd724.zip
sorts and generates priority statements from priority node.def entries
Diffstat (limited to 'scripts/priority.pl')
-rw-r--r--scripts/priority.pl25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/priority.pl b/scripts/priority.pl
new file mode 100644
index 0000000..a8cf9b6
--- /dev/null
+++ b/scripts/priority.pl
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+my %pri;
+
+ # first check if this file exists, and if so ensure this is a config file.
+my @files = `find /opt/vyatta/share/vyatta-cfg -name 'node.def'`;
+foreach my $f (@files) {
+ my $result = `grep 'priority:' $f`;
+ if (defined $result && length($result) != 0) {
+ my @r = split " ", $result;
+ if (defined $r[1]) {
+ $pri{$r[1]} = $f;
+ #stuff in hash here
+ }
+ }
+}
+
+
+#now sort
+
+foreach my $key ( sort { $a <=> $b } keys %pri ) {
+ my $loc = substr($pri{$key},0,-10);
+ my $loc = substr($loc,39);
+ print $key," ",$loc,"\n";
+}