summaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorTasos Latsas <tlatsas2000@gmail.com>2012-08-08 10:30:05 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2012-08-08 13:16:07 +0200
commitec0fb097b62d5861d382f56ce03246a51076bdfe (patch)
tree5333e9a51cff118ac95116482792aef83babe905 /rc.d
parentfd096b445062eea02c20595ed863ce891b313779 (diff)
downloadnetctl-ec0fb097b62d5861d382f56ce03246a51076bdfe.tar.gz
netctl-ec0fb097b62d5861d382f56ce03246a51076bdfe.tar.xz
Better error handling in automatic connect scripts
Signed-off-by: Tasos Latsas <tlatsas2000@gmail.com>
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/net-auto-wired8
-rwxr-xr-xrc.d/net-auto-wireless8
2 files changed, 6 insertions, 10 deletions
diff --git a/rc.d/net-auto-wired b/rc.d/net-auto-wired
index 859e57d..86ccd2d 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"$'\n' \
+ " 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..9094232 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"$'\n' \
+ " WIRELESS_INTERFACE='your_interface'"
fi
case "$1" in