chore: initial repo setup with baseline config backup
- Pull current config from router (OpenWRT 24.10.2) - Add backup, safe-apply, and push-all scripts - Add CLAUDE.md with workflow rules and context - Add network-map.md with current topology and planned VLANs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
22
scripts/push-all.sh
Executable file
22
scripts/push-all.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# Push ALL config files to router and reload.
|
||||
# WARNING: Use safe-apply.sh for individual risky changes (network, firewall, wireless).
|
||||
# This script is for bulk pushes of low-risk configs (dhcp, system, dropbear).
|
||||
set -euo pipefail
|
||||
|
||||
ROUTER="${ROUTER:-openwrt}"
|
||||
CONFIGS=(dhcp dropbear firewall network system wireless)
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
CONFIG_DIR="$SCRIPT_DIR/../config"
|
||||
|
||||
echo "WARNING: This will push all configs and reload. Use safe-apply.sh for network/firewall changes."
|
||||
read -rp "Continue? [y/N] " answer
|
||||
[[ "${answer,,}" == "y" ]] || exit 0
|
||||
|
||||
for f in "${CONFIGS[@]}"; do
|
||||
echo " pushing $f..."
|
||||
ssh "$ROUTER" "cat > /etc/config/$f" < "$CONFIG_DIR/$f"
|
||||
done
|
||||
|
||||
ssh "$ROUTER" "uci commit && reload_config"
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user