use direct path

This commit is contained in:
liyong
2022-02-09 21:10:26 +08:00
committed by XiaoLi
parent 027f4404fb
commit b5dda71360
3 changed files with 9 additions and 24 deletions
+3 -8
View File
@@ -4,9 +4,7 @@ set -x
# 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
openresty_sub_config_dir='/usr/local/openresty/nginx/conf.d'
echo $openresty_sub_config_dir
# -- Make sub config dir
@@ -18,17 +16,14 @@ cp conf/moicen/*.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
openresty_lua_scripts_dir='/usr/local/openresty/nginx/scripts'
echo $openresty_lua_scripts_dir
# -- Make scripts dir
mkdir -p $openresty_lua_scripts_dir
# -- Copy scripts file
cp scripts/*.lua $openresty_lua_scripts_dir
# -- Replace scripts path in file
replaced_scripts_path=$(echo $openresty_lua_scripts_dir | sed 's_/_\\/_g')
echo "$replaced_scripts_path"
sed -i -e "s/<SCRIPT_PATH>/$replaced_scripts_path/" \
sed -i -e "s|<SCRIPT_PATH>|$openresty_lua_scripts_dir|" \
"$openresty_lua_scripts_dir"/combine.lua \
"$openresty_lua_scripts_dir"/convert_audio.lua \
"$openresty_lua_scripts_dir"/test_upyun_upload.lua \