Moved local dir to /opt/sys_config
Improved error logging and added function handling calls with log and return values Improved check for matching sudo rule
This commit is contained in:
@@ -14,11 +14,11 @@
|
||||
# fi
|
||||
# return 0
|
||||
#}
|
||||
if [ ! -f $(pwd)/setup_system.conf ]; then
|
||||
if [ ! -f $(dirname "$0")/setup_system.conf ]; then
|
||||
echo "System configuration not found. Please make a copy of setup_system.conf.dist, name it setup_system.conf and check the settings in it before running."
|
||||
exit 1
|
||||
echo "Press any key to continue" && read -n 1 -s -r && exit 1
|
||||
fi
|
||||
source $(pwd)/setup_system.conf
|
||||
source $(dirname "$0")/setup_system.conf
|
||||
|
||||
#Check if the Data- Directory is encrypted
|
||||
check_data_isecrypted() {
|
||||
@@ -32,11 +32,21 @@ check_data_isecrypted() {
|
||||
|
||||
# Functions for logging
|
||||
elog_init() {
|
||||
#Create a new logfile and put some text in it
|
||||
echo $@ | tee ${LOGFILE}
|
||||
}
|
||||
elog_add() {
|
||||
#Append some text to the logile
|
||||
echo $@ | tee ${LOGFILE} -a
|
||||
}
|
||||
elog_add_command() {
|
||||
#Run a command, capture all output (STD and ERR) to the logfile AND in variable RETTXT AND output to screen
|
||||
#Returns the exit value of the command in $? and in RETNO
|
||||
RETTXT=$( { $@ > >(tee -a ${LOGFILE}); } 2> >(tee -a ${LOGFILE}) )
|
||||
RETNO=$?
|
||||
echo "${RETTXT}"
|
||||
return ${RETNO}
|
||||
}
|
||||
|
||||
# Will set variable DAVTOKEN_USER and DAVTOKEN_PASS to the stored value or get a new one
|
||||
get_nc_token() {
|
||||
|
||||
Reference in New Issue
Block a user