Jelajahi Sumber

Added ability to be logged if available.

Daniel Gibbs 10 tahun lalu
induk
melakukan
496463f45c
2 mengubah file dengan 6 tambahan dan 0 penghapusan
  1. 3 0
      functions/check_root.sh
  2. 3 0
      functions/check_systemdir.sh

+ 3 - 0
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

+ 3 - 0
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