websoft9/docker/proxy/s6/w9init/migration.sh

23 lines
478 B
Bash
Raw Normal View History

2023-10-25 15:33:30 +08:00
#!/bin/bash
set +e
nginx_proxy(){
2023-10-25 17:26:08 +08:00
2023-10-26 16:37:36 +08:00
current_time=$(date +%s)
shadow_modified_time=$(stat -c %Y /etc/shadow)
time_difference=$((current_time - shadow_modified_time))
if [ ! -f /data/nginx/proxy_host/initproxy.conf ] || [ $time_difference -le 60 ]
2023-10-25 17:26:08 +08:00
then
cp /etc/initproxy.conf /data/nginx/proxy_host/
echo "Update initproxy.conf to Nginx"
else
echo "Don't need to update initproxy.conf to Nginx"
fi
2023-10-25 16:14:54 +08:00
2023-10-25 15:33:30 +08:00
}
nginx_proxy
set -e