On 2/3/19 12:39 PM, Grant Taylor wrote:
On 2/3/19 6:26 AM, Michael Orlitzky wrote:
You can add commands to your existing network configuration that will be
run when an interface comes up. For example, in /etc/conf.d/net,

    ifup_wlan0="iwconfig \$int key s:secretkey enc open essid foobar"

Ya....  I find that to be an absolute kludge.  Does it work?  Yes.  Is
it clean?  Probably not.  Is it graceful?  Absolutely not.

Think about how it's possible to configure bridging / bonding / VLANs
via various parameters and having netifrc construct the commands that
are run in the background.


Ultimately netifrc is just a shell script that parses another shell script to construct a third shell script. I don't think doing it with only two shell scripts is that much less elegant =)

You could go all the way and write your own OpenRC service as /etc/init.d/whatever. You can make it depend on the network being up, and then just write everything that you want it to do into the start function with the corresponding "undo" steps in the stop function.

If the series of commands is long and complicated and if you sometimes want to do/undo this subset of the configuration independently, then that's how I'd do it.

Reply via email to