mirror of
https://github.com/m8tin/cis.git
synced 2026-06-02 14:56:58 +02:00
Removed printCisRoot.sh
This commit is contained in:
+11
-4
@@ -66,7 +66,7 @@ function prepare.setCIS() {
|
|||||||
&& base.abort "Array CIS was not initialized correctly."
|
&& base.abort "Array CIS was not initialized correctly."
|
||||||
|
|
||||||
# Retrieves the variables for this module using 'BASH_SOURCE[0]', the infos about the script using '$0'.
|
# Retrieves the variables for this module using 'BASH_SOURCE[0]', the infos about the script using '$0'.
|
||||||
local _ROOT_TRUNK _FULLBASENAME _FULLSCRIPTNAME
|
local _ROOT_TRUNK _FULLBASENAME _FULLSCRIPTNAME _CIS_ROOT
|
||||||
_FULLBASENAME="$(realpath "${BASH_SOURCE[0]}" 2> /dev/null)"
|
_FULLBASENAME="$(realpath "${BASH_SOURCE[0]}" 2> /dev/null)"
|
||||||
_FULLSCRIPTNAME="$(realpath "${0}" 2> /dev/null)"
|
_FULLSCRIPTNAME="$(realpath "${0}" 2> /dev/null)"
|
||||||
|
|
||||||
@@ -80,11 +80,18 @@ function prepare.setCIS() {
|
|||||||
|
|
||||||
_ROOT_TRUNK="${_ROOT_TRUNK%cis/*}"
|
_ROOT_TRUNK="${_ROOT_TRUNK%cis/*}"
|
||||||
done
|
done
|
||||||
readonly _ROOT_TRUNK _FULLBASENAME _FULLSCRIPTNAME
|
|
||||||
|
|
||||||
# Folders always ends with an tailing '/'
|
# Folders always ends with an tailing '/'
|
||||||
CIS[ROOT]="${_ROOT_TRUNK:?"Missing ROOT_TRUNK"}cis/"
|
_CIS_ROOT="${_ROOT_TRUNK:?"Missing ROOT_TRUNK"}cis/"
|
||||||
CIS[DOMAIN]="$(base.printOwnDomain "${CIS[ROOT]:?"Missing ROOT"}")"
|
readonly _ROOT_TRUNK _FULLBASENAME _FULLSCRIPTNAME _CIS_ROOT
|
||||||
|
|
||||||
|
[ -d "${_CIS_ROOT:?"Missing CIS_ROOT"}" ] \
|
||||||
|
&& [ -d "${_CIS_ROOT}core/" ] \
|
||||||
|
&& [ -d "${_CIS_ROOT}definitions/" ] \
|
||||||
|
&& [ -d "${_CIS_ROOT}states/" ] \
|
||||||
|
&& CIS[ROOT]="${_CIS_ROOT}"
|
||||||
|
|
||||||
|
CIS[DOMAIN]="$(base.printOwnDomain "${CIS[ROOT]:?"Missing global CIS_ROOT"}")"
|
||||||
|
|
||||||
[ -z "${CIS[DOMAIN]}" ] \
|
[ -z "${CIS[DOMAIN]}" ] \
|
||||||
&& echo \
|
&& echo \
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
_SCRIPT="$(readlink -f "${0}" 2> /dev/null)"
|
|
||||||
_CIS_ROOT="${_SCRIPT%%/core/*}/" #Removes longest matching pattern '/core/*' from the end
|
|
||||||
|
|
||||||
[ -d "${_CIS_ROOT}" ] \
|
|
||||||
&& [ -d "${_CIS_ROOT}definitions/" ] \
|
|
||||||
&& [ -d "${_CIS_ROOT}states/" ] \
|
|
||||||
&& echo "${_CIS_ROOT}" \
|
|
||||||
&& exit 0
|
|
||||||
|
|
||||||
echo "FAIL: Unable to detect CIS_ROOT" >&2
|
|
||||||
exit 1
|
|
||||||
Reference in New Issue
Block a user