#!/bin/bash set -e systemctl reset-failed douyinweb-api || true systemctl start douyinweb-api sleep 4 systemctl is-active douyinweb-api ENVFILE=$(systemctl show douyinweb-api -p EnvironmentFiles --value | head -1 | cut -d: -f1 | tr -d ' ') echo "ENVFILE=$ENVFILE" if [ -n "$ENVFILE" ] && [ -f "$ENVFILE" ]; then set -a # shellcheck disable=SC1090 . "$ENVFILE" set +a fi while IFS= read -r line; do case "$line" in DY_S3_*=*|S3_*=*) export "$line" ;; esac done < <(systemctl show douyinweb-api -p Environment --value | tr ' ' '\n') echo "DY_S3_ENABLED=${DY_S3_ENABLED:-}" echo "DY_S3_PUBLIC_BASE=${DY_S3_PUBLIC_BASE:-}" cd /opt/douyinWEB/backend PYTHONPATH=. .venv/bin/python /tmp/_diag_s3_settings.py PYTHONPATH=. .venv/bin/python /tmp/_backfill_avatars.py