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:
authormboelen <michael@cisofy.com>2014-11-25 16:22:52 +0300
committermboelen <michael@cisofy.com>2014-11-25 16:22:52 +0300
commitf826a4f63fea267e4ec0a5528216564338cc9976 (patch)
treed56edc73d01ef44b9a5dbabba8317f5712da9066 /include
parentfb459efeb7c408aa2962d08a20a80f114eea03e8 (diff)
Added Progress function, --progress to Register function and docker detection
Diffstat (limited to 'include')
-rw-r--r--include/functions18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/functions b/include/functions
index b14af11d..840f7d4f 100644
--- a/include/functions
+++ b/include/functions
@@ -37,6 +37,7 @@
# IsRunning Check if a process is running
# IsVirtualMachine Check if this system is a virtual machine
# ParseNginx Parse nginx configuration lines
+# Progress Show progress on screen
# ReportException Add an exception to the report file (for debugging purposes)
# ReportSuggestion Add a suggestion to report file
# ReportWarning Add a warning and priority to report file
@@ -184,7 +185,7 @@
INDENT=$1
;;
--no-break | --nobreak | -nb)
- ECHOCMD="echo -en"
+ ECHOPARAMS="-n"
;;
--result)
shift
@@ -222,10 +223,11 @@
if [ ${CRONJOB} -eq 0 ]; then
# Check if we already have already discovered a proper echo command tool. It not, set it default to 'echo'.
if [ "${ECHOCMD}" = "" ]; then ECHOCMD="echo"; fi
- ${ECHOCMD} "\033[${INDENT}C${TEXT}\033[${SPACES}C${RESULTPART}"
+ ${ECHOCMD} ${ECHOPARAMS} "\033[${INDENT}C${TEXT}\033[${SPACES}C${RESULTPART}"
else
echo "${TEXT}${RESULTPART}"
fi
+ ECHOPARAMS=""
fi
fi
}
@@ -565,6 +567,7 @@
if [ ! "${FIND}" = "" ]; then
case ${FIND} in
bochs) ISVIRTUALMACHINE=1; VMTYPE="bochs"; VMFULLTYPE="Bochs CPU emulation" ;;
+ docker) ISVIRTUALMACHINE=1; VMTYPE="docker"; VMFULLTYPE="Docker container" ;;
kvm) ISVIRTUALMACHINE=1; VMTYPE="kvm"; VMFULLTYPE="KVM" ;;
lxc) ISVIRTUALMACHINE=1; VMTYPE="lxc"; VMFULLTYPE="Linux Containers" ;;
lxc-libvirt) ISVIRTUALMACHINE=1; VMTYPE="lxc-libvirt"; VMFULLTYPE="libvirt LXC driver (Linux Containers" ;;
@@ -847,6 +850,14 @@
done
}
+ # Show progress on screen (useful for silent tests)
+ # Tip: use this function from Register with the --progress parameter
+ Progress()
+ {
+ if [ ${CRONJOB} -eq 0 ]; then
+ ${ECHOCMD} -en "."
+ fi
+ }
# Function to determine what the real file location is
RealFilename()
@@ -914,6 +925,9 @@
shift
PREQS_MET=$1
;;
+ --progress)
+ Progress
+ ;;
--root-only)
shift
if [ "$1" = "YES" -o "$1" = "yes" ]; then