[O] Use reload instead of restart

This commit is contained in:
Azalea Gui
2023-03-09 02:23:29 -05:00
parent 7fdefba71e
commit a8c76ec657
+6 -1
View File
@@ -10,16 +10,21 @@ DEPL="/etc/nginx/hres/aza.moe"
# Update static files (since mv is way faster than cp, we use a tmp folder)
if [ -d "$DEPL.tmp1" ]; then
echo "Deleting old tmp folder..."
sudo rm -rf "$DEPL.tmp1"
fi
echo "Copying new files to tmp folder..."
cp -r dist "$DEPL.tmp1"
if [ -d "$DEPL" ]; then
echo "Moving old production folder to to-delete location..."
sudo mv "$DEPL" "$DEPL.del"
fi
echo "Moving new files to production folder..."
sudo mv "$DEPL.tmp1" "$DEPL"
if [ -d "$DEPL.del" ]; then
echo "Deleting old production folder..."
sudo rm -rf "$DEPL.del"
fi
# Reload nginx
sudo nginx -t && sudo systemctl restart nginx
sudo nginx -t && sudo systemctl reload nginx