From 496463f45c278ffa2f2ad12b9d419ffbb849861d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 28 Dec 2015 16:57:10 +0000 Subject: [PATCH] Added ability to be logged if available. --- functions/check_root.sh | 3 +++ functions/check_systemdir.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/functions/check_root.sh b/functions/check_root.sh index 3f62a5d30..8f2e5ed54 100644 --- a/functions/check_root.sh +++ b/functions/check_root.sh @@ -6,5 +6,8 @@ lgsm_version="271215" if [ $(whoami) = "root" ]; then fn_printfailnl "Do NOT run this script as root!" + if [ -d "${scriptlogdir}" ]; then + fn_scriptlog "${selfname} attempted to run as root." + fi exit 1 fi diff --git a/functions/check_systemdir.sh b/functions/check_systemdir.sh index 30a192609..c1f65a0d7 100644 --- a/functions/check_systemdir.sh +++ b/functions/check_systemdir.sh @@ -6,5 +6,8 @@ lgsm_version="271215" if [ ! -d "${systemdir}" ]; then fn_printfailnl "Cannot access ${systemdir}: No such directory" + if [ -d "${scriptlogdir}" ]; then + fn_scriptlog "Cannot access ${systemdir}: No such directory." + fi exit 1 fi