aboutsummaryrefslogtreecommitdiffstats
path: root/del-syslog
diff options
context:
space:
mode:
Diffstat (limited to 'del-syslog')
-rwxr-xr-xdel-syslog4
1 files changed, 4 insertions, 0 deletions
diff --git a/del-syslog b/del-syslog
index 372ed2d..8df0bb8 100755
--- a/del-syslog
+++ b/del-syslog
@@ -32,6 +32,7 @@ sub del_sysklogd_entry {
my ($package) = @_;
my $file = "/etc/syslog.conf";
+
my $content;
open(my $in, '<', $file)
or die "Can't open $file for reading: $!";
@@ -58,6 +59,9 @@ sub del_rsyslog_entry {
my $file = "/etc/rsyslog.d/$package.conf";
+ # check the file exists
+ return unless -f $file;
+
# check the file is the one created by package installation
open(my $in, '<', $file)
or die "Can't open $file for reading: $!";