[arch-projects] [netcfg][PATCH] Better error handling in automatic connect scripts
Signed-off-by: Tasos Latsas <tlatsas2000@gmail.com> --- rc.d/net-auto-wired | 8 +++----- rc.d/net-auto-wireless | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/rc.d/net-auto-wired b/rc.d/net-auto-wired index 859e57d..d3c4c5a 100755 --- a/rc.d/net-auto-wired +++ b/rc.d/net-auto-wired @@ -6,14 +6,12 @@ . /etc/conf.d/netcfg if [[ ! -x /usr/sbin/ifplugd ]]; then - echo "Please install 'ifplugd' to use net-auto-wired" - exit 1 + exit_stderr "Please install 'ifplugd' to use net-auto-wired" fi if [[ -z "${WIRED_INTERFACE}" ]]; then - echo "No interface name set. Add to /etc/conf.d/netcfg a line" - echo " WIRED_INTERFACE=\"your_interface\"" - exit 1 + exit_stderr "No interface name set. Add to /etc/conf.d/netcfg a line \ +WIRED_INTERFACE=\"your_interface\"" fi CFG=/etc/ifplugd/ifplugd.conf diff --git a/rc.d/net-auto-wireless b/rc.d/net-auto-wireless index 79c43b0..6cfbd10 100755 --- a/rc.d/net-auto-wireless +++ b/rc.d/net-auto-wireless @@ -6,14 +6,12 @@ . /etc/conf.d/netcfg if [[ ! -x /usr/sbin/wpa_actiond ]]; then - echo "Please install 'wpa_actiond' to use net-auto-wireless" - exit 1 + exit_stderr "Please install 'wpa_actiond' to use net-auto-wireless" fi if [[ -z "${WIRELESS_INTERFACE}" ]]; then - echo "No interface name set. Add to /etc/conf.d/netcfg a line" - echo " WIRELESS_INTERFACE=\"your_interface\"" - exit 1 + exit_stderr "No interface name set. Add to /etc/conf.d/netcfg a line \ +WIRELESS_INTERFACE=\"your_interface\"" fi case "$1" in -- 1.7.11.4
On Wed, Aug 8, 2012 at 10:30 AM, Tasos Latsas <tlatsas2000@gmail.com> wrote:
Signed-off-by: Tasos Latsas <tlatsas2000@gmail.com> --- rc.d/net-auto-wired | 8 +++----- rc.d/net-auto-wireless | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/rc.d/net-auto-wired b/rc.d/net-auto-wired index 859e57d..d3c4c5a 100755 --- a/rc.d/net-auto-wired +++ b/rc.d/net-auto-wired @@ -6,14 +6,12 @@ . /etc/conf.d/netcfg
if [[ ! -x /usr/sbin/ifplugd ]]; then - echo "Please install 'ifplugd' to use net-auto-wired" - exit 1 + exit_stderr "Please install 'ifplugd' to use net-auto-wired" fi
if [[ -z "${WIRED_INTERFACE}" ]]; then - echo "No interface name set. Add to /etc/conf.d/netcfg a line" - echo " WIRED_INTERFACE=\"your_interface\"" - exit 1 + exit_stderr "No interface name set. Add to /etc/conf.d/netcfg a line \ +WIRED_INTERFACE=\"your_interface\"" fi
CFG=/etc/ifplugd/ifplugd.conf diff --git a/rc.d/net-auto-wireless b/rc.d/net-auto-wireless index 79c43b0..6cfbd10 100755 --- a/rc.d/net-auto-wireless +++ b/rc.d/net-auto-wireless @@ -6,14 +6,12 @@ . /etc/conf.d/netcfg
if [[ ! -x /usr/sbin/wpa_actiond ]]; then - echo "Please install 'wpa_actiond' to use net-auto-wireless" - exit 1 + exit_stderr "Please install 'wpa_actiond' to use net-auto-wireless" fi
if [[ -z "${WIRELESS_INTERFACE}" ]]; then - echo "No interface name set. Add to /etc/conf.d/netcfg a line" - echo " WIRELESS_INTERFACE=\"your_interface\"" - exit 1 + exit_stderr "No interface name set. Add to /etc/conf.d/netcfg a line \ +WIRELESS_INTERFACE=\"your_interface\"" fi
case "$1" in -- 1.7.11.4
Applied. Next time, please, watch the whitespace (both in the source and in the generated output). This trivial patch took a non-trivial time to fix. - Jouke
On 09/08/12 18:29, Jouke Witteveen wrote:
Applied. Next time, please, watch the whitespace (both in the source and in the generated output). This trivial patch took a non-trivial time to fix.
- Jouke
Yeah won't happen again, I failed with git-send-mail and used TB (got it working now). Thanks -- Tasos Latsas GPG key: 0x414301DF
participants (2)
-
Jouke Witteveen
-
Tasos Latsas