mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-18 22:43:00 +08:00
19 lines
418 B
Bash
Executable File
19 lines
418 B
Bash
Executable File
#!/bin/sh
|
|
# easymesh-vlan-backup — snapshot /etc/config/network before VLAN changes
|
|
|
|
BKDIR=/etc/easymesh
|
|
BKFILE="$BKDIR/network.bak"
|
|
|
|
mkdir -p "$BKDIR"
|
|
|
|
if [ ! -f /etc/config/network ]; then
|
|
logger -t easymesh-vlan "no /etc/config/network found, skipping backup"
|
|
exit 1
|
|
fi
|
|
|
|
cp /etc/config/network "$BKFILE"
|
|
date +%s > "$BKFILE.timestamp"
|
|
|
|
logger -t easymesh-vlan "backed up network config to $BKFILE"
|
|
exit 0
|