Following in the footsteps of commit 5ac9b45f.
* Support WIRED_INTERFACE in /etc/conf.d/netcfg * Check that WIRED_INTERFACE is defined else abort when starting * Add EnvironmentFile to systemd auto-wired service * Documentation typos and fixups
Signed-off-by: Dan McGee dan@archlinux.org --- config/netcfg | 2 ++ docs/features | 6 +++--- ifplugd/net-auto-wired | 7 +++++++ ifplugd/net-auto-wired.service | 1 + wpa_actiond/net-auto-wireless | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/config/netcfg b/config/netcfg index 055a87d..600062a 100644 --- a/config/netcfg +++ b/config/netcfg @@ -1,5 +1,7 @@ ## Define to the name of your wireless interface for net-auto-wireless WIRELESS_INTERFACE="wlan0" +## Define to the name of your wireless interface for net-auto-wired +WIRED_INTERFACE="eth0"
## List of profiles that can be started by net-auto-wireless ## defaults to the list of all wireless profiles diff --git a/docs/features b/docs/features index 3a7f3c3..6a93d75 100644 --- a/docs/features +++ b/docs/features @@ -36,13 +36,13 @@ Through the use of wpa_actiond which calls commands on a wpa_supplicant event, n To use this:
1. Install core/wpa_actiond -2. In /etc/rc.conf set WIRELESS_INTERFACE to your wireless interface, eg: +2. In /etc/conf.d/netcfg set WIRELESS_INTERFACE to your wireless interface, eg:
- WIRELESS_INTERFACE="wlan0" + WIRELESS_INTERFACE="wlan0"
3. Run /etc/rc.d/net-auto-wireless start
-To run on boot, add 'net-auto-wireles' to your DAEMONS line. +To run on boot, add 'net-auto-wireless' to your DAEMONS line.
## Per interface configuration
diff --git a/ifplugd/net-auto-wired b/ifplugd/net-auto-wired index 9af8505..d81ee0e 100755 --- a/ifplugd/net-auto-wired +++ b/ifplugd/net-auto-wired @@ -2,12 +2,19 @@
. /etc/rc.conf . /etc/rc.d/functions +. /etc/conf.d/netcfg
if [[ ! -x /usr/sbin/ifplugd ]]; then echo "Please install 'ifplugd' to use net-auto-wired" exit 1 fi
+if [ -z "${WIRED_INTERFACE}" ]; then + echo "No interface name set. Add a line to /etc/conf.d/netcfg:" + echo " WIRED_INTERFACE="your_interface"" + exit 1 +fi + CFG=/etc/ifplugd/ifplugd.conf ACTION=/etc/ifplugd/netcfg.action PIDFILE=/var/run/ifplugd.$WIRED_INTERFACE.pid diff --git a/ifplugd/net-auto-wired.service b/ifplugd/net-auto-wired.service index b356fef..321a62e 100644 --- a/ifplugd/net-auto-wired.service +++ b/ifplugd/net-auto-wired.service @@ -4,6 +4,7 @@ Before=network.target
[Service] EnvironmentFile=/etc/rc.conf +EnvironmentFile=/etc/conf.d/netcfg EnvironmentFile=-/etc/ifplugd/ifplugd.conf ExecStart=-/usr/sbin/ifplugd -i $WIRED_INTERFACE -r /etc/ifplugd/netcfg.action -fIn -u0 -d10 ExecStop=-/usr/sbin/ifplugd -k -i $WIRED_INTERFACE -r /etc/ifplugd/netcfg.action diff --git a/wpa_actiond/net-auto-wireless b/wpa_actiond/net-auto-wireless index d6a3c44..4f45dc4 100755 --- a/wpa_actiond/net-auto-wireless +++ b/wpa_actiond/net-auto-wireless @@ -11,7 +11,7 @@ if [[ ! -x /usr/sbin/wpa_actiond ]]; then fi
if [ -z "${WIRELESS_INTERFACE}" ]; then - echo "No interface name set. Add to /etc/conf.d/netcfg a line" + echo "No interface name set. Add a line to /etc/conf.d/netcfg:" echo " WIRELESS_INTERFACE="your_interface"" exit 1 fi
arch-projects@lists.archlinux.org