Files
resty_functions/cp_scripts_alchemy.sh
T

31 lines
747 B
Bash
Raw Normal View History

#!/bin/sh
set -x
# Openresty config
# -- Get openresty config path
2022-05-29 23:37:14 +08:00
openresty_sub_config_dir='/usr/local/openresty/nginx/conf.d'
echo $openresty_sub_config_dir
# -- Make sub config dir
mkdir -p $openresty_sub_config_dir
# -- Copy sun config file
cp conf/alchemy/*.conf $openresty_sub_config_dir
# Lua scripts
# -- Get openresty install path
2022-02-09 21:10:26 +08:00
openresty_lua_scripts_dir='/usr/local/openresty/nginx/scripts'
echo $openresty_lua_scripts_dir
2022-02-08 13:57:15 +08:00
# -- Make scripts dir
mkdir -p $openresty_lua_scripts_dir
2022-02-08 13:57:15 +08:00
# -- Copy scripts file
cp scripts/*.lua $openresty_lua_scripts_dir
2022-02-08 13:57:15 +08:00
# -- Replace scripts path in file
2022-02-09 21:10:26 +08:00
sed -i -e "s|<SCRIPT_PATH>|$openresty_lua_scripts_dir|" \
"$openresty_lua_scripts_dir"/*.lua
# Reload openresty
openresty -t
openresty -s reload