I use Slackware, in which GUI utilities are minimized. Frankly, I also do not ship X so often. However, at the time when I was sitting on Ubunt, I liked the Network Manager, which was hanging in the tray and indicated the operation of network interfaces. However, another thing was important - it was possible to create “configurations” of network settings in it and switch between them (like “work”, “house”, “cafe”). In Slackware, I only had ncurses-based netconfig on hand, which stupidly copied some files. By repeatedly running it in different places, I didn’t get the effect that I would like - the settings from the previous place were erased. Then I decided to write a simple script that allows you to "switch" settings in the style of Network Manager. I did it roughly, I do not exclude that there is a more subtle solution, but it works and is to some extent universal. I publish it below, if someone will be useful:
echo File $ file . $ 1 not exists, please point to existing one
exit
fi
done
for file in $ FILES ; do
ln -sfv $ file . $ 1 $ file
done
echo Restarting inet
/ etc / rc.d / rc.inet1 restart
It is very easy to use. It pushes links to files in which the actual configuration is stored. I only track /etc/rc.d/rc.inet1.conf and /etc/resolv.conf. In this case, they will no longer be files, but links to /etc/rc.d/rc.inet1.conf.location and /etc/resolv.conf.location. I create them manually, then I do switch_net, then netconfig, when I come to a “new place”. To switch from one to another, it is enough to execute switch_net with superuser rights: