Files
hair_change_color/start.sh
T
2026-08-10 22:38:12 +08:00

20 lines
694 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 启动发型更换服务(systemd: hair_change.service)
set -e
ROOT="/home/ubuntu/hair_change_color"
VENV_PY="${ROOT}/.venv/bin/python"
if [ ! -x "$VENV_PY" ]; then
echo "错误: 虚拟环境不存在,请先执行:"
echo " python3 -m venv ${ROOT}/.venv && ${ROOT}/.venv/bin/pip install -r ${ROOT}/backend/requirements.txt"
exit 1
fi
echo "[$(date '+%Y-%m-%d %H:%M:%S')] 重启 hair_change.service ..."
sudo systemctl restart hair_change.service
sleep 1
sudo systemctl --no-pager --full status hair_change.service || true
echo "访问地址: https://meida.xiangsilian.com/hair/"
echo "日志: /home/ubuntu/log/hair_error.log /home/ubuntu/log/hair_access.log"