#!/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."