X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=801d23fd566fcb322188afbc6e49621614099a02;hb=5d904390482bcc78d2f43ff3c99dd87f159179e3;hp=eb8c4f2ac5c0547ba1a19f3b46f8eee94ac0613c;hpb=ad6aedb9016c5ab9dbc0ac73830206dc71025930;p=ossec-hids-cn.git diff --git a/debian/postinst b/debian/postinst index eb8c4f2..801d23f 100755 --- a/debian/postinst +++ b/debian/postinst @@ -31,7 +31,9 @@ esac . /usr/share/carnet-tools/functions.sh # get installation directory -. /etc/ossec-init.conf +if [ -e /etc/ossec-init.conf ]; then + . /etc/ossec-init.conf +fi if [ "X${DIRECTORY}" = "X" ]; then DIRECTORY="/var/ossec" fi @@ -49,7 +51,7 @@ script=' BEGIN { FS = "\"" } -/^[ \t]*/ { +// { if (max < $2) max = $2 } @@ -57,10 +59,12 @@ END { print max }; ' -sid=100000 if [ -e "$local_rules" ]; then sid=$(awk "$script" "$local_rules") fi +if [ -z "$sid" ]; then + sid=100000 +fi # update local rules with our policy if [ -e "$local_rules" ]; then @@ -71,40 +75,48 @@ fi cp-update --comment '' \ ossec-hids-cn "$local_rules.$$" < + 1002 rsync Events ignored - + 1002 ^sophie|^smartd - Events ignored + Ignore Sophie/SMARTd - - - + 3303 Events ignored - - 3356 - Ignore blacklisted mail... + + 3356 + Ignore blacklisted mail + + + 1002 + cache + ^named + Ignore BIND cache warnings + + + + 2933 + Updated timestamp for job + ^anacron + Ignore Anacron warnings + EOF cp_mv "$local_rules.$$" "$local_rules" # and restart the service -if [ -x /usr/sbin/invoke-rc.d ]; then - invoke-rc.d ossec-hids restart -else - /etc/init.d/ossec-hids restart -fi +service ossec-hids restart || true # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts.