Files
op-packages/luci-app-easymesh/root/usr/bin/easymesh-vlan-backup
T

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