Skip to content

Instantly share code, notes, and snippets.

@andrewspiers
Created May 4, 2014 23:06
Show Gist options
  • Save andrewspiers/99ba812d34c53f100f76 to your computer and use it in GitHub Desktop.
Save andrewspiers/99ba812d34c53f100f76 to your computer and use it in GitHub Desktop.
iptables-dump.sh
#!/bin/bash
#dump iptables rules to a timestamped file
#requires iptables-save which is in Redhat based distributions.
set -x
set -e
DESTDIR="/root/iptables-saves"
mkdir -p ${DESTDIR}
iptables-save > "${DESTDIR}/iptables-save-$(date +%Y-%m-%d-%H-%M)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment