There is a risk to lose access while editing network configuration on a remote server. Many network configuration scripts and utilities ignore this problem. Afraid to lose access to your server? We’ve tried to get rid of this flaw and written our script which allows you to rollback network settings if access has been lost.
Spasbrosok script may be launched under Debian and Ubuntu distro family systems that use the SystemD initialization system. Also, workability under CentOS 7 has been confirmed. The script doesn’t work under CentOS 8 due to the package “network-scripts” haven’t installed by default. You should be able to use Spasbrosok after switching a CentOS 8 installation to using network-scripts. Also, a Netplan utility used by default in Ubuntu starting from 18.04. Netplan has a network configuration rollback function, so you can just use it. Spasbrosok script needs nothing more than standard utilities included in most popular distros.
Spasbrosok usage guide
Attention! Commands provided assuming you’re working as the root user. The script needs root permissions to work.
1. Download the script
2. Permit execution of the script
chmod u+x spasbrosok.sh
3. Launch the script before editing network configuration files
You should receive an answer like indicated on the screenshot:
4. You can start to edit network configuration files now.
5. After saving changes, start the script again
If you see a message like below, your server has a network connection with a new configuration. Type 5 symbols to make the new configuration persistent. Please pay attention that you can’t correct your input with the Backspace key. If your input will be wrong, the old configuration will be restored from the backup copy.
If you see the message without 5 red symbols, the connection with the server has been lost.
You can try to type 5 random symbols or just wait for 25 seconds until a network rollback.
That’s all! Hope that our utility will help you to avoid connection loss and reduce the time for network configuration.