Fixed base.module.sh, migrated EXAMPLE_CHECK.off and improved log.module.sh

This commit is contained in:
m8in
2026-05-18 20:06:29 +02:00
parent 216cd4ec48
commit bd76357b1d
3 changed files with 7 additions and 10 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ function prepare.setCIS() {
_ROOT_TRUNK="${_FULLSCRIPTNAME%cis/*}"
while [ ! -d "${_ROOT_TRUNK}cis/core/" ]; do
[ "${_ROOT_TRUNK}" == "${0}" ] \
[ "${_ROOT_TRUNK}" == "${_FULLSCRIPTNAME}" ] \
&& base.abort ' Unable to find root folder of CIS!' 'It seams the script does not belong to CIS.'
[ "${_ROOT_TRUNK}" == "/" ] \
@@ -1,9 +1,6 @@
#!/bin/bash
source /cis/core/base.module.sh
_CHECK="$(readlink -f "${0}" 2> /dev/null)"
# Folders always ends with an tailing '/'
_CIS_ROOT="${_CHECK%%/definitions/*}/" #Removes longest matching pattern '/definitions/*' from the end
_GENERIC_CHECKS="${_CIS_ROOT:?"Missing CIS_ROOT"}script/monitor/generic/"
${_GENERIC_CHECKS:?"Missing GENERIC_CHECKS"}CIS_OWN_DOMAIN_CHECK.sh "your-host.your-domain.net[:ssh_port]"
${CIS[GENERICMONITORCHECKS]:?"Missing GENERICMONITORCHECKS"}CIS_OWN_DOMAIN_CHECK.sh "your-host.your-domain.net[:ssh_port]"
+4 -4
View File
@@ -1,5 +1,7 @@
#!/bin/bash
source /cis/core/base.module.sh
#Function, to highlight bad messages.
function log.bad() {
@@ -134,9 +136,7 @@ function log.optional(){
#Function, to start a script.
function log.start(){
local _MESSAGE="${@:-""}"
local _CISROOT="${CIS[ROOT]:?"log.start(): Missing CIS[ROOT]."}"
local _SCRIPTDIR="${CIS[SCRIPTDIR]:?"log.start(): Missing CIS[SCRIPTDIR]."}"
local _SERVICE="$(echo "${_SCRIPTDIR##${_CISROOT}/}" | tr '[:lower:]' '[:upper:]')"
local _SERVICE="$(echo "${_SCRIPTDIR##${CIS[ROOT]:?"log.start(): Missing CIS[ROOT]"}/}" | tr '[:lower:]' '[:upper:]')"
local _COMMAND="${CIS[SCRIPTNAME]:?"log.start(): Missing CIS[SCRIPTNAME]."}"
[ -z "${_MESSAGE:-""}" ] \