joukewitteveen/netctl — pull request #39 by rallyemax (2013-06-07 00:09:02+00:00)
Title: Configuration file for netctl to permit DHCP defaults to be set globally.

Here is one way of implementing the changes discussed in Arch bug #35668 (https://bugs.archlinux.org/task/35668?project=1&cat%5B0%5D=31&string=netctl), which I filed. I did my best to follow your conventions in documentation.

The changes are very minor. All DHCP variables that previously had hardcoded defaults in the various bash files are now set in /etc/netctl/netctl.conf, which is sourced right before the profile being invoked is sourced, so users can override the global defaults merely by setting them in the profiles. If netctl.conf is not changed by the user, the program will behave exactly like it did before these changes.

Additional DHCP options can also be passed using the netctl.conf, but the applicable lines are commented out by default and a "know what you're doing" warning appears in the comments.

Since the default timeout and default DHCP client are now defined in netctl.conf, I've removed the bash defaults from 'ip'. If netctl.conf is deleted, 'globals' will throw an error (same as when an invoked profile does not exist).

I added a reference to the config file in the man page for netctl, but didn't get into any details as the config file itself is documented.

I'm running my modified version and things seem to be working OK. No errors yet.

Feel free to use this or ignore it at your discretion. I'm happy to help if you want to change something or implement it in a different way.