diff options
-rwxr-xr-x | cron-sh/security.sh | 23 | ||||
-rwxr-xr-x | share/msec | 20 |
2 files changed, 38 insertions, 5 deletions
diff --git a/cron-sh/security.sh b/cron-sh/security.sh index 1c2dfec..f0b6124 100755 --- a/cron-sh/security.sh +++ b/cron-sh/security.sh @@ -1,5 +1,23 @@ #!/bin/bash +LCK=/var/run/msec-security.pid + +function cleanup() { + rm -f $LCK +} + +if [ -f $LCK ]; then + if [ -d /proc/`cat $LCK` ]; then + exit 0 + else + rm -f $LCK + fi +fi + +echo -n $$ > $LCK + +trap cleanup 0 + if [[ ! -f /var/lib/msec/security.conf ]]; then echo "Can't access /var/lib/msec/security.conf." exit 1 @@ -148,11 +166,6 @@ fi ### rpm database check if [[ ${RPM_CHECK} == yes ]]; then - if [ -f /var/lib/rpm/__db.001 -o -f /var/lib/rpm/__db.002 ]; then - rm -f /var/lib/rpm/__db.00* - rpm --rebuilddb - fi - rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}\t%{INSTALLTIME}\n" | sort > ${RPM_QA_TODAY} rm -f ${RPM_VA_TODAY}.tmp @@ -6,8 +6,28 @@ # Version : $Id$ # Author : Frederic Lepied # Created On : Thu Dec 13 11:36:50 2001 +# Purpose : entry script to run hardness script or change +# the security level. #--------------------------------------------------------------- +LCK=/var/run/msec.pid + +function cleanup() { + rm -f $LCK +} + +if [ -f $LCK ]; then + if [ -d /proc/`cat $LCK` ]; then + exit 0 + else + rm -f $LCK + fi +fi + +echo -n $$ > $LCK + +trap cleanup 0 + MSEC=/usr/share/msec/msec.py OPT="" |