Changelog - 2026-01-03

Bug Fix

Fixed: smart_backup could not detect configuration changes

Issue

The backup script always reported No configuration changes detected, even after actual config updates (for example, OpenClash config.yaml). As a result, no new backup had been pushed for about two weeks.

Root cause

  1. git reset --hard origin/master was executed too early.
  2. The old workflow reset local state before extracting new config files, which hid real differences.

Old order:

  • Reset -> Extract -> Compare

Correct order:

  • Extract -> Compare -> Commit -> Push -> Sync(reset)

What was changed

1) Git operation flow adjusted (scripts/smart_backup.sh)

  • Removed early git reset --hard and git pull from initialization phase.
  • Performed sync reset only after successful push.
  • Added retry/merge handling for push conflicts.

2) OpenClash config backup enhanced

  • Added backup for /etc/openclash/*.yaml.
  • Ensured config.yaml changes are included in change detection.
  • Stored OpenClash backup files under openclash/.

3) Change detection improved

  • Compared both configs/ and openclash/ directories.
  • Updated commit message generation to include OpenClash filenames.

Validation

  • Tested with a real Raspberry Pi + ImmortalWrt device.
  • Confirmed detection on modified config files.
  • Confirmed commit and push behavior works as expected.

Example commit:

Update: openclash, config.yaml (2026-01-03)

User Impact

Mainly benefits users who:

  • edit OpenClash settings frequently
  • rely on GitHub backup history
  • need reliable change tracking across router configs

Upgrade Instructions

# Download latest script
cd /tmp
wget https://raw.githubusercontent.com/Ronchy2000/Raspi-ImmortalWrt/master/scripts/smart_backup.sh

# Upload to Raspberry Pi
scp smart_backup.sh root@192.168.1.1:/root/

# Run a test backup
ssh root@192.168.1.1 "/root/smart_backup.sh"