mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 02:29:58 +00:00
install-ngxblocker: add set_mode()
* ensure all $SCRIPT_FILES are executable
This commit is contained in:
parent
0b3dcbe86d
commit
a4e9d4dcdc
1 changed files with 15 additions and 0 deletions
|
@ -141,6 +141,16 @@ download_files() {
|
|||
fi
|
||||
}
|
||||
|
||||
set_mode() {
|
||||
local mode=$1 dir=$2 file=
|
||||
local file_list="$(echo $@ | awk '{$1=$2=""; print}' | sed -e 's/^[ \t]*//')"
|
||||
|
||||
for file in $file_list; do
|
||||
printf "Setting mode: $mode => $dir/$file\n"
|
||||
chmod $mode $dir/$file
|
||||
done
|
||||
}
|
||||
|
||||
check_config() {
|
||||
local x= dirs="$*"
|
||||
|
||||
|
@ -283,6 +293,11 @@ main() {
|
|||
download_files conf.d $CONF_DIR $CONF_FILES
|
||||
download_files bots.d $BOTS_DIR $BOT_FILES
|
||||
download_files / $SCRIPT_DIR $SCRIPT_FILES
|
||||
|
||||
# ensures scripts are executable
|
||||
if [ "$DRY_RUN" = "N" ]; then
|
||||
set_mode 700 $SCRIPT_DIR $SCRIPT_FILES
|
||||
fi
|
||||
}
|
||||
|
||||
## START ##
|
||||
|
|
Loading…
Add table
Reference in a new issue