add auto copy config and scripts files scripts

This commit is contained in:
liyong
2022-02-08 10:51:47 +08:00
committed by XiaoLi
parent 2545370141
commit ebc73eed8d
4 changed files with 88 additions and 6 deletions
+25 -2
View File
@@ -1,8 +1,31 @@
#!/bin/sh
set -x
openresty_sub_config_dir=/usr/local/etc/openresty/conf.d
# Openresty config
# -- Get openresty config path
openresty_config_file_path=$(openresty -t 2>&1 | tr '\n' '\f' | sed -r 's/.*file[[:space:]](.*)[[:space:]]syntax.*/\1/')
openresty_config_path=${openresty_config_file_path%/*}
openresty_sub_config_dir=$openresty_config_path/conf.d
echo $openresty_sub_config_dir
# -- Make sub config dir
mkdir -p $openresty_sub_config_dir
# -- Copy sun config file
cp conf/local_macos/*.conf $openresty_sub_config_dir
# Lua scripts
# -- Get openresty install path
openresty_install_path=$(openresty -V 2>&1 | tr '\n' '\f' | sed -r 's/.*--prefix=(.*)[[:space:]]--with-cc.*/\1/')
openresty_lua_scripts_dir=$openresty_install_path/scripts
echo $openresty_lua_scripts_dir
mkdir -p $openresty_lua_scripts_dir
cp scripts/*.lua $openresty_lua_scripts_dir
# Reload openresty
openresty -t
openresty -s reload