summaryrefslogtreecommitdiff
path: root/scripts/system/vyatta_update_logrotate.pl
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-08 17:56:37 +0100
committerGitHub <noreply@github.com>2021-01-08 17:56:37 +0100
commit8c81230819a1bde768a5948328232c5def0af0fd (patch)
treedd4f7d6c84e00e18e025a8f4ca43eeefa7731832 /scripts/system/vyatta_update_logrotate.pl
parentcc36c93479d954ac6ab5454c2d25e86edbc57c61 (diff)
parentac2586bc6471a141203e21ec3bfe97bfbcad6672 (diff)
downloadvyatta-cfg-system-8c81230819a1bde768a5948328232c5def0af0fd.tar.gz
vyatta-cfg-system-8c81230819a1bde768a5948328232c5def0af0fd.zip
Merge pull request #136 from dmbaturin/remove-unused-scripts
T671: remove apparently unused scripts.
Diffstat (limited to 'scripts/system/vyatta_update_logrotate.pl')
-rwxr-xr-xscripts/system/vyatta_update_logrotate.pl51
1 files changed, 0 insertions, 51 deletions
diff --git a/scripts/system/vyatta_update_logrotate.pl b/scripts/system/vyatta_update_logrotate.pl
deleted file mode 100755
index 8620ede1..00000000
--- a/scripts/system/vyatta_update_logrotate.pl
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/perl
-
-# Exit code:
-# 0 - success
-# 1 - missing parameter
-# 2 - invalid files or size parameters
-# 3 - unable to write logrotate config
-
-use strict;
-
-my $cfg_dir = "/opt/vyatta/etc/logrotate";
-my $file = "global";
-my $log_file = "/var/log/messages";
-my $log_conf = "${cfg_dir}/$file";
-if ($#ARGV == 3) {
- $file = shift;
- $log_file = "/var/log/user/$file";
- $log_conf = "${cfg_dir}/file_$file";
-}
-my $files = shift;
-my $size = shift;
-my $set = shift;
-
-if (!defined($files) || !defined($size) || !defined($set)) {
- exit 1;
-}
-
-if (!($files =~ m/^\d+$/) || !($size =~ m/^\d+$/)) {
- exit 2;
-}
-
-# just remove it and make a new one below
-# (the detection mechanism in XORP doesn't work anyway)
-unlink $log_conf;
-
-open my $out, '>', $log_conf
- or exit 3;
-if ($set == 1) {
- print $out <<EOF;
-$log_file {
- missingok
- notifempty
- create
- rotate $files
- size=${size}k
-}
-EOF
-}
-close $out;
-
-exit 0;