diff --git a/resource/deploy.sh b/resource/deploy.sh index 3b6e6da..fad2fb7 100755 --- a/resource/deploy.sh +++ b/resource/deploy.sh @@ -2,13 +2,14 @@ set -e -SERVER_ADDRESS=47.107.32.69 +SERVER_ADDRESS=192.168.3.3 +SERVER_PORT=5022 USER=root function update() { echo "start update packages" - ssh "$USER@$SERVER_ADDRESS" < /dev/null 2>&1; then echo "OpenResty has installed." else @@ -34,10 +35,14 @@ function init() { opm get bungle/lua-resty-session fi - if [ ! -f /root/Server/frp_0.60.0_linux_amd64/frps ]; then + if [ -f /root/Server/frp_0.60.0_linux_amd64/frps ]; then + echo "frps has installed." + else + pushd /root/Server # wget https://github.com/fatedier/frp/releases/download/v0.60.0/frp_0.60.0_linux_amd64.tar.gz wget https://frp-by1.wwvvww.cn:44048/s/frps/download -O frp_0.60.0_linux_amd64.tar.gz tar xvf ./frp_0.60.0_linux_amd64.tar.gz + popd fi if command -v docker &> /dev/null; then @@ -56,6 +61,15 @@ function init() { if [ ! -d /root/Server ]; then mkdir -p /root/Server /root/Server/logs fi + + if [ "$(docker ps -q -f name=librespeed)" ]; then + echo "librespeed has running." + else + pushd /root/Server + docker run -d --name=librespeed -e PASSWORD=88888888 -p 8087:80 \ + -v ${PWD}/librespeed:/config --restart unless-stopped lscr.io/linuxserver/librespeed:latest + popd + fi EOF echo "update packages finished." diff --git a/resource/openresty.service b/resource/openresty.service index cdceaca..deca9f5 100644 --- a/resource/openresty.service +++ b/resource/openresty.service @@ -22,7 +22,7 @@ WorkingDirectory=/root/Server ExecStartPre=/usr/local/openresty/nginx/sbin/nginx -t -q -g 'daemon on; master_process on;' -c /root/Server/conf/nginx.conf -p /root/Server ExecStart=/usr/local/openresty/nginx/sbin/nginx -g 'daemon on; master_process on;' -c /root/Server/conf/nginx.conf -p /root/Server ExecReload=/usr/local/openresty/nginx/sbin/nginx -g 'daemon on; master_process on;' -s reload -c /root/Server/conf/nginx.conf -p /root/Server -ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /usr/local/openresty/nginx/logs/nginx.pid +ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /root/Server/logs/nginx.pid TimeoutStopSec=5 KillMode=mixed