backup-server-state: skip iptables if nft is installed
This commit is contained in:
parent
87a3fd48df
commit
b4f35af35c
|
@ -426,9 +426,13 @@ backup_iptables() {
|
||||||
debug "Backup iptables"
|
debug "Backup iptables"
|
||||||
|
|
||||||
iptables_bin=$(command -v iptables)
|
iptables_bin=$(command -v iptables)
|
||||||
|
nft_bin=$(command -v nft)
|
||||||
|
|
||||||
|
if [ -n "${nft_bin}" ]; then
|
||||||
|
debug "* nft found, skip iptables"
|
||||||
|
else
|
||||||
if [ -n "${iptables_bin}" ]; then
|
if [ -n "${iptables_bin}" ]; then
|
||||||
last_result=$({ ${iptables_bin} -L -n -v; ${iptables_bin} -t filter -L -n -v; } > "${backup_dir}/iptables.txt")
|
last_result=$({ ${iptables_bin} -L -n -v; ${iptables_bin} -t filter -L -n -v; } >> "${backup_dir}/iptables.txt")
|
||||||
last_rc=$?
|
last_rc=$?
|
||||||
|
|
||||||
if [ ${last_rc} -eq 0 ]; then
|
if [ ${last_rc} -eq 0 ]; then
|
||||||
|
@ -458,6 +462,7 @@ backup_iptables() {
|
||||||
else
|
else
|
||||||
debug "* iptables-save not found"
|
debug "* iptables-save not found"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
backup_sysctl() {
|
backup_sysctl() {
|
||||||
|
|
Loading…
Reference in a new issue