mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-03 18:03:56 +08:00
💋 Sync 2026-10-04 04:16:09
This commit is contained in:
1 parent
f6b2df73ec
commit
f62992fd80
745 files changed
+212416
-1173
No files matched your search
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
DIR="$1"
|
||||
[ -z "$DIR" ] && { echo "Usage: restore.sh <backup-dir>"; exit 1; }
|
||||
[ ! -d "$DIR" ] && { echo "Directory not found: $DIR"; exit 1; }
|
||||
|
||||
SAFETY="/etc/config.bak.pre-restore.$(date +%s)"
|
||||
mkdir -p "$SAFETY"
|
||||
for f in "$DIR"/*; do
|
||||
[ -f "$f" ] || continue
|
||||
base=$(basename "$f")
|
||||
[ -f "/etc/config/$base" ] && cp "/etc/config/$base" "$SAFETY/"
|
||||
cp "$f" "/etc/config/$base"
|
||||
done
|
||||
|
||||
for c in network firewall dhcp wireless wizard netwizard taskplan; do
|
||||
uci -q commit $c 2>/dev/null
|
||||
done
|
||||
|
||||
/etc/init.d/network reload >/dev/null 2>&1 &
|
||||
/etc/init.d/firewall reload >/dev/null 2>&1 &
|
||||
|
||||
echo "Restored from $DIR"
|
||||
echo "Previous state saved to $SAFETY"
|
||||
Reference in new issue
Block a user