Browse Source

Added directory check

- fixes error message: find: ‘/home/server/serverfiles’: No such file or directory
pull/958/head
Marvin Lehmann 9 years ago
committed by GitHub
parent
commit
8881508e9a
  1. 4
      lgsm/functions/check_permissions.sh

4
lgsm/functions/check_permissions.sh

@ -9,6 +9,7 @@ local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_check_ownership(){ fn_check_ownership(){
if [ -d "${filesdir}" ]; then
if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]||[ $(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]||[ $(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then
fn_print_fail_nl "Permissions issues found" fn_print_fail_nl "Permissions issues found"
fn_script_log_fatal "Permissions issues found" fn_script_log_fatal "Permissions issues found"
@ -20,10 +21,11 @@ fn_check_ownership(){
} | column -s $'\t' -t | tee -a "${scriptlog}" } | column -s $'\t' -t | tee -a "${scriptlog}"
core_exit.sh core_exit.sh
fi fi
fi
} }
fn_check_permissions(){ fn_check_permissions(){
if [ -n "${functionsdir}" ]; then if [ -d "${functionsdir}" ]; then
if [ $(find "${functionsdir}" -type f -not -executable|wc -l) -ne "0" ]; then if [ $(find "${functionsdir}" -type f -not -executable|wc -l) -ne "0" ]; then
fn_print_fail_nl "Permissions issues found" fn_print_fail_nl "Permissions issues found"
fn_script_log_fatal "Permissions issues found" fn_script_log_fatal "Permissions issues found"

Loading…
Cancel
Save