diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-06 17:21:07 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-06 17:21:07 -0700 |
commit | cabb370ecbc56b2721c6b17f7863258f0798eaca (patch) | |
tree | 581b47b2c15d7aaff1d379c876f9b1161b3de83c /scripts | |
parent | 8ddb46697ada893f5b92c0a18adc4b86eec409a3 (diff) | |
parent | c412935a4a66cbdc26d7a8a24a17621612eafc9e (diff) | |
download | vyatta-cfg-quagga-cabb370ecbc56b2721c6b17f7863258f0798eaca.tar.gz vyatta-cfg-quagga-cabb370ecbc56b2721c6b17f7863258f0798eaca.zip |
Merge branch 'jenner' of 192.168.100.1:git/vyatta-cfg-system into jenner
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/system/vyatta_update_syslog.pl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/system/vyatta_update_syslog.pl b/scripts/system/vyatta_update_syslog.pl index 49662c30..83fa9576 100755 --- a/scripts/system/vyatta_update_syslog.pl +++ b/scripts/system/vyatta_update_syslog.pl @@ -43,6 +43,12 @@ sub add_entry { push @{ $entries{$target} }, $selector; } +# This allows overloading local values in CLI +my %facmap = ( + 'all' => '*', + 'protocols' => 'local7', +); + # This builds a data structure that maps from target # to selector list for that target sub read_config { @@ -50,7 +56,7 @@ sub read_config { foreach my $facility ( $config->listNodes("$level facility") ) { my $loglevel = $config->returnValue("$level facility $facility level"); - $facility = '*' if ( $facility eq 'all' ); + $facility = $facmap{$facility} if ( $facmap{$facility} ); $loglevel = '*' if ( $loglevel eq 'all' ); add_entry( $facility . '.' . $loglevel, $target ); @@ -84,7 +90,8 @@ foreach my $user ( $config->listNodes('user') ) { if ( -r $SYSLOG_CONF ) { system("sed -e '/$BEGIN_VYATTA/,/$END_VYATTA/d' <$SYSLOG_CONF >$SYSLOG_TMP") - == 0 or die "Can't read $SYSLOG_CONF"; + == 0 + or die "Can't read $SYSLOG_CONF"; } open my $out, '>>', $SYSLOG_TMP |