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 18.104.22.168 || 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 22.214.171.124 || 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?