Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2016-08-15 20:50:52 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-08-15 20:50:52 +0300
commit242f91ab971150863568e8e13046201194400760 (patch)
treef12abc526247d3ef3f179ce86986d1bec208fcc0
parentbf7b8ab44ed0979650f3cc717e7cd41979f8c354 (diff)
Added --rootdir for forensics
-rw-r--r--include/parameters16
-rwxr-xr-xlynis1
2 files changed, 17 insertions, 0 deletions
diff --git a/include/parameters b/include/parameters
index 9f193c62..85147e96 100644
--- a/include/parameters
+++ b/include/parameters
@@ -289,6 +289,22 @@
PURPLE="${NORMAL}";
;;
+ # Root directory (useful for forensics)
+ --rootdir | --root-dir)
+ if [ $# -gt 1 ]; then
+ shift
+ if [ -d $1 ]; then
+ ROOTDIR="$1"
+ else
+ echo "Invalid rootdir provided (does not exist)"
+ exit 1
+ fi
+ else
+ echo "Need a root directory (e.g. /mnt/forensics)"
+ exit 1
+ fi
+ ;;
+
# Skip execution of plugins
--skip-plugins | --no-plugins)
SKIP_PLUGINS=1
diff --git a/lynis b/lynis
index c786d798..98b8dc8a 100755
--- a/lynis
+++ b/lynis
@@ -606,6 +606,7 @@ ${NORMAL}
echo " Auditor: ${AUDITORNAME}"
echo " Test category: ${TEST_CATEGORY_TO_CHECK}"
echo " Test group: ${TEST_GROUP_TO_CHECK}"
+ if [ ! "${ROOTDIR}" = "/" ]; then echo " Root directory: ${ROOTDIR}"; fi
echo " ---------------------------------------------------"
fi