Files
resty_functions/cp_scripts_local_macos.sh
T

34 lines
915 B
Bash
Raw Normal View History

2022-02-03 20:17:56 +08:00
#!/bin/sh
set -x
# Openresty config
2022-02-03 20:17:56 +08:00
# -- Get openresty config path
2022-02-09 21:10:26 +08:00
openresty_sub_config_dir='/usr/local/etc/openresty/conf.d'
echo $openresty_sub_config_dir
2022-02-03 20:17:56 +08:00
# -- 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
2022-02-09 21:10:26 +08:00
openresty_lua_scripts_dir='/usr/local/opt/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|" \
2022-02-08 13:57:15 +08:00
"$openresty_lua_scripts_dir"/combine.lua \
"$openresty_lua_scripts_dir"/convert_audio.lua \
"$openresty_lua_scripts_dir"/test_upyun_upload.lua \
"$openresty_lua_scripts_dir"/upyun_upload.lua
# Reload openresty
openresty -t
openresty -s reload