I'm about to change
iptables configuration and interface speed and duplex settings over SSH. What are the possibilities to rollback the changes in case of host becomes unreachable? I guess simple:
ip addr add 10.10.10.1/24 dev eth0; ping -c1 188.8.131.52 || ip addr add 192.168.1.1/24 dev eth0
..is bit risky because if SSH connection drops immediately after the IP address change, then shell should be also killed and
ping -c1 184.108.40.206 || ip addr add 192.168.1.1/24 dev eth0 part is never executed? Should one use
crontab in case of dangerous changes on a remote host? Any other clever method?