File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,11 +71,27 @@ fn_check_permissions() {
7171 echo -en " File:"
7272 echo -en " ${findnotexecutable} "
7373 } | column -s $' \t ' -t | tee -a " ${lgsmlog} "
74- if [ " ${monitorflag} " == 1 ]; then
75- alert=" permissions"
76- alert.sh
74+
75+ # Attempt to make the files executable
76+ fn_print_information_nl " Attempting to fix permissions issues"
77+ fn_script_log_info " Attempting to fix permissions issues"
78+ echo " ${findnotexecutable} " | xargs chmod +x
79+
80+ # Re-check if there are still non-executable files
81+ findnotexecutable=" $( find " ${modulesdir} " -type f -not -executable) "
82+ findnotexecutablewc=" $( find " ${modulesdir} " -type f -not -executable | wc -l) "
83+ if [ " ${findnotexecutablewc} " -ne " 0" ]; then
84+ fn_print_fail_nl " Failed to resolve permissions issues"
85+ fn_script_log_fail " Failed to resolve permissions issues"
86+ if [ " ${monitorflag} " == 1 ]; then
87+ alert=" permissions"
88+ alert.sh
89+ fi
90+ core_exit.sh
91+ else
92+ fn_print_ok_nl " Permissions issues resolved"
93+ fn_script_log_pass " Permissions issues resolved"
7794 fi
78- core_exit.sh
7995 fi
8096 fi
8197
You can’t perform that action at this time.
0 commit comments