summaryrefslogtreecommitdiff
path: root/scripts/update-priority.pl
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2021-01-04 20:20:23 +0200
committerDaniil Baturin <daniil@vyos.io>2021-01-07 22:27:30 +0200
commit5475f9ab0f9bc3f547491d6f2e2e441ea4ffed57 (patch)
tree084b6de808168784a14956a3ac5bd9476f50f77b /scripts/update-priority.pl
parente150d17264965751f0024699ff238a53204f0422 (diff)
downloadvyatta-cfg-5475f9ab0f9bc3f547491d6f2e2e441ea4ffed57.tar.gz
vyatta-cfg-5475f9ab0f9bc3f547491d6f2e2e441ea4ffed57.zip
Remove unused scripts.
Diffstat (limited to 'scripts/update-priority.pl')
-rwxr-xr-xscripts/update-priority.pl75
1 files changed, 0 insertions, 75 deletions
diff --git a/scripts/update-priority.pl b/scripts/update-priority.pl
deleted file mode 100755
index feb1e7f..0000000
--- a/scripts/update-priority.pl
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/perl
-
-# Author: Arthur Xiong
-# Date: 04/15/2010
-# Description: Script to automatically update/add priority tag with
-# some value for each node.def according to the inputs
-
-# **** License ****
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# This code was originally developed by Vyatta, Inc.
-# Portions created by Vyatta are Copyright (C) 2006-2010 Vyatta, Inc.
-# All Rights Reserved.
-#
-# **** End License ****
-
-use strict;
-use warnings;
-
-die "Usage: update-priority.pl <priority-file> <path-to-template>"
- unless $#ARGV == 1;
-
-my $priority;
-my $path;
-my $comment;
-my $priority_line;
-my $node_def;
-my $priority_file = $ARGV[0];
-my $prefix = $ARGV[1];
-
-open my $pf, '<', $priority_file or die "$priority_file can't be opened";
-while (<$pf>) {
- chomp;
- next if /^#.*/ or /^$/;
- die "Syntax Error \"$_\"" unless /^(\d+)\s+(\S+)(|\s+|\s+#.*)$/;
- $priority = $1;
- $path = $2;
- $comment = $3;
-
- $priority_line = "";
- $priority_line = "priority: " . $priority . "\t" . $comment . "\n";
- print "priority_line: $priority_line";
-
- $node_def = "";
- $node_def = $prefix . "/" . $path . "/" . "node.def";
- print "node_def: ", $node_def, "\n";
-
- open my $nf, '<', $node_def or die "$node_def can't be opened";
- open my $nfn, '>', "$node_def.new" or die "$node_def.new can't be opened";
- while (<$nf>) {
- last unless /^#.*/ or /^$/;
- print $nfn $_;
- }
- print $nfn $_ if /^(tag|multi):/;
- print $nfn $priority_line if $priority != 0;
- print $nfn $_ unless /^priority:\s(\d+)/ or /^(tag|multi):/;
- while (<$nf>) {
- print $nfn $_ unless /^priority:\s(\d+)/;
- }
- close $nfn;
- close $nf;
-
- rename "$node_def.new", "$node_def"
- or die "$node_def.new can't be renamed to $node_def";
-
- print "Updated $node_def\n\n";
-}
-close $pf;