Est il vraiment besoin de réinventer la roue ?
console@routeur:~$ apt-cache show netenv
Package: netenv
Priority: extra
Section: admin
Installed-Size: 344
Maintainer: Frank Küster <frank@kuesterei.ch>
Architecture: all
Version: 0.94.3-17
Depends: debconf (>= 0.5) | debconf-2.0, dialog (>= 0.9a-20020309a-1), coreutils | stat
Filename: pool/main/n/netenv/netenv_0.94.3-17_all.deb
Size: 72688
MD5sum: f4e4d23b0dc6e5c8c78a473ff10d429f
Description: Configure your system for different network environments
Netenv lets you choose your network environment (and other things) upon
boot, which is useful for notebook computers. The difference to similar
packages is that it doesn't try to autodetect your environment, but
expects your input. You can, however, specify a default or pass it a
parameter from the boot prompt to allow for unattained boot. You can also
use it to switch between environments without rebooting.
.
It will work with PCMCIA or builtin network cards.
Tag: hardware::laptop, interface::commandline, network::configuration, role::sw:utility
Sinon, pour répondre plus précisément à ta question: oui.
Maintenant, comment, ça dépend de comment tu lances ton startx…