diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-10-19 11:25:38 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-10-19 11:25:38 -0700 |
commit | 724e9418e3f6acf81fcc29172de6c1f5e3335fa7 (patch) | |
tree | 384b0be3e93a8de0b0d890f5fee18d04590ea01c /scripts/system/vyatta_update_syslog.pl | |
parent | 20c7a06a9dd38fb705a245cb755a351241113461 (diff) | |
download | vyatta-cfg-724e9418e3f6acf81fcc29172de6c1f5e3335fa7.tar.gz vyatta-cfg-724e9418e3f6acf81fcc29172de6c1f5e3335fa7.zip |
move "system" configuration templates/scripts to vyatta-cfg-system.
Diffstat (limited to 'scripts/system/vyatta_update_syslog.pl')
-rw-r--r-- | scripts/system/vyatta_update_syslog.pl | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/scripts/system/vyatta_update_syslog.pl b/scripts/system/vyatta_update_syslog.pl deleted file mode 100644 index a55fe61..0000000 --- a/scripts/system/vyatta_update_syslog.pl +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/perl - -use strict; -my $SYSLOG_CONF = '/etc/syslog.conf'; - -my $match1 = shift; -my $match2 = shift; -my $update_line = shift; - -if (!defined($match1) || !defined($match2) || !defined($update_line)) { - exit 1; -} - -if (system("touch $SYSLOG_CONF")) { - exit 2; -} - -my $exp1 = ""; -my $exp2 = ""; -if ($match1 ne "") { - $exp1 = $match1; - if ($match2 ne "") { - $exp2 = $match2; - } -} elsif ($match2 ne "") { - $exp1 = $match2; -} - -if ($exp2 ne "") { - if (system("sed -i '/$exp1/{/$exp2/d}' $SYSLOG_CONF")) { - exit 2; - } -} elsif ($exp1 ne "") { - if (system("sed -i '/$exp1/d' $SYSLOG_CONF")) { - exit 3; - } -} - -open(OUT, ">>$SYSLOG_CONF") or exit 4; -if ($update_line ne "") { - print OUT "$update_line"; -} -close OUT; - -sleep 1; -if (system("/usr/sbin/invoke-rc.d sysklogd restart")) { - exit 5; -} - -exit 0; - |