[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop:[5811]
From:       owes () users ! sourceforge ! net
Date:       2011-08-18 18:00:50
Message-ID: E1Qu6te-0002PN-Sk () sfp-svn-1 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 5811
          http://ipcop.svn.sourceforge.net/ipcop/?rev=5811&view=rev
Author:   owes
Date:     2011-08-18 18:00:50 +0000 (Thu, 18 Aug 2011)

Log Message:
-----------
Only modify /etc/logrotate.conf when needed.

Modified Paths:
--------------
    ipcop/trunk/src/misc-progs/restartsyslogd.c

Modified: ipcop/trunk/src/misc-progs/restartsyslogd.c
===================================================================
--- ipcop/trunk/src/misc-progs/restartsyslogd.c	2011-08-18 14:32:35 UTC (rev 5810)
+++ ipcop/trunk/src/misc-progs/restartsyslogd.c	2011-08-18 18:00:50 UTC (rev 5811)
@@ -156,9 +156,12 @@
         exit(ERR_ETC);
     }
 
-    verbose_printf(1, "Modifying logrotate.conf ... \n");
-    snprintf(buffer, STRING_SIZE, "/bin/sed -i -e 's/^rotate.*/rotate %s/' \
                /etc/logrotate.conf", log_keep);
-    safe_system(buffer);
+    snprintf(buffer, STRING_SIZE, "/bin/grep 'rotate %s' /etc/logrotate.conf \
>/dev/null", log_keep); +    if (safe_system(buffer)) {
+        verbose_printf(1, "Modifying logrotate.conf ... \n");
+        snprintf(buffer, STRING_SIZE, "/bin/sed -i -e 's/^rotate.*/rotate %s/' \
/etc/logrotate.conf", log_keep); +        safe_system(buffer);
+    }
 
     verbose_printf(1, "Modifying rsyslogd configfile ... \n");
     /* O_CREAT with O_EXCL will make open() fail if the file already exists -


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic