Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- [ $1 == 'help' ] && {
- echo -e "
- Usage snapconf pre|post|diff
- "
- exit
- }
- [ $1 == 'pre' ] && {
- ext=pre
- nvram show &> /tmp/nvram.${ext}
- iptables -t filter -nL > /tmp/iptables-filter.${ext}
- iptables -t nat -nL > /tmp/iptables-nat.${ext}
- iptables -t mangle -nL > /tmp/iptables-mangle.${ext}
- ip route > /tmp/iproute.${ext}
- ip rule > /tmp/iprule.${ext}
- ifconfig | grep inet > /tmp/ifconfig.${ext}
- }
- [ $1 == 'post' ] && {
- ext=post
- nvram show &> /tmp/nvram.${ext}
- iptables -t filter -nL > /tmp/iptables-filter.${ext}
- iptables -t nat -nL > /tmp/iptables-nat.${ext}
- iptables -t mangle -nL > /tmp/iptables-mangle.${ext}
- ip route > /tmp/iproute.${ext}
- ip rule > /tmp/iprule.${ext}
- ifconfig | grep inet > /tmp/ifconfig.${ext}
- }
- [ $1 == 'diff' ] && {
- diff /tmp/nvram.pre /tmp/nvram.post
- diff /tmp/iptables-filter.pre /tmp/iptables-filter.post
- diff /tmp/iptables-nat.pre /tmp/iptables-nat.post
- diff /tmp/iptables-mangle.pre /tmp/iptables-mangle.post
- diff /tmp/iproute.pre /tmp/iproute.post
- diff /tmp/iprule.pre /tmp/iprule.post
- diff /tmp/ifconfig.pre /tmp/ifconfig.post
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement