Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Samiya committed Mar 4, 2024
1 parent a01cd6c commit 2bd8ffa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ initialize_or_update_repo() {
# 尝试获取并检出指定路径
if git fetch --depth=1 origin main && git checkout FETCH_HEAD; then
# 如果获取和检出成功,检查是否有变化
if ! diff -r --exclude=logs --exclude=data "$TMP_DIR/$SUB_DIR" "$TARGET_DIR" > /dev/null 2>&1; then
find "$TARGET_DIR" -type f ! -path "$TARGET_DIR/logs/*" ! -path "$TARGET_DIR/data/*" -exec md5sum {} + | sort > /tmp/target_dir.md5
find "$TMP_DIR/$SUB_DIR" -type f -exec md5sum {} + | sort > /tmp/tmp_dir.md5
if ! diff /tmp/target_dir.md5 /tmp/tmp_dir.md5 > /dev/null; then
echo "检测到$CONFIG_PATH下的文件变化。更新并重新运行python /root/VintageVigil/main.py..."
# 终止当前运行的main.py进程
if [ ! -z "$MAIN_PY_PID" ]; then
Expand Down

0 comments on commit 2bd8ffa

Please sign in to comment.