This will fix my question from a different thread, and the answer to your question for SuSE is;
/etc/SuSE-release
Thanks,
On Mon, 2006-08-21 at 14:02 -0300, Daniel Cid wrote:
Hi Gentuxx,
Thanks for the script. I just made a small change to it so that instead
of hardcoding /var/ossec as the directory, it would read it from
/etc/ossec-init.conf. What I added is:
"
# Finding where ossec is installed
. /etc/ossec-init.conf
if [ "X${DIRECTORY}" = "X" ]; then
DIRECTORY="/var/ossec"
fi
OSSEC_CONTROL="${DIRECTORY}/bin/ossec-control"
"
In addition to that, is there a way to identify a system as Gentoo? (for
example, Red hat has the file "/etc/redhat-release"). We need that so
we can configure the scripts during install...
Thanks,
--
Daniel B. Cid
dcid ( at ) ossec.net
On 8/20/06, gentuxx <[EMAIL PROTECTED]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> I managed to modify one of the existing rc-scripts on my gentoo system
> for ossec.
>
> Usage: ossec { start|stop|restart|status|configtest }
>
> Works like a charm for me.
>
> [EMAIL PROTECTED] ~ # rc-update add ossec default
> * ossec added to runlevel default
> [EMAIL PROTECTED] ~ # /etc/init.d/ossec start
> * Starting ossec-hids
> ...
>
>
> [ ok ]
> [EMAIL PROTECTED] ~ #
>
>
> - --
> gentux
> echo "hfouvyyAhnbjm/dpn" | perl -pe 's/(.)/chr(ord($1)-1)/ge'
>
> gentux's gpg fingerprint ==> 5495 0388 67FF 0B89 1239 D840 4CF0 39E2
> 18D3 4A9E
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (GNU/Linux)
>
> iD8DBQFE6OJiTPA54hjTSp4RAi41AKDLVOqG7scSAYkNMvEi4YZca6ICEQCgwGlG
> FloN7tFSZ5ZzZfeurogTctE=
> =+WaK
> -----END PGP SIGNATURE-----
>
>
>
> #!/sbin/runscript
>
> opts="${opts} status configtest"
> OSSEC_CONTROL='/var/ossec/bin/ossec-control'
>
> depend() {
> need net
> use logger
> }
>
> configtest() {
> ebegin "Checking OSSEC Configuration"
> checkconfig
> eend $?
> }
>
> checkconfig() {
>
> CONFIGFILE="${CONFIGFILE:-/var/ossec/etc/ossec.conf}"
> if [ ! -r "${CONFIGFILE}" ]; then
> eerror "Unable to read configuration file: ${CONFIGFILE}"
> return 1
> fi
>
> # Maybe put some kind of config file syntax checking in here? XML is a little different
> # so maybe not.
> return $ret
> }
>
> start() {
> checkconfig || return 1
> ebegin "Starting ossec-hids"
> ${OSSEC_CONTROL} start > /dev/null 2>&1
> eend $?
> }
>
> stop() {
> checkconfig || return 1
> ebegin "Stopping ossec-hids"
> ${OSSEC_CONTROL} stop > /dev/null 2>&1
> eend $?
> }
>
> restart() {
> if ! service_started "${myservice}" ; then
> eerror "OSSEC is not running! Please start it before trying to reload it."
> else
> checkconfig || return 1
> ebegin "Reloading ossec"
> svc_stop ${OSSEC_CONTROL}
> svc_start ${OSSEC_CONTROL}
> eend $?
> fi
> }
>
> status() {
> checkconfig || return 1
> ${OSSEC_CONTROL} status
> }
>
>
>
|
