aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2015-01-11 12:39:08 -0500
committerMike Gilbert <floppym@gentoo.org>2015-01-15 10:28:58 -0500
commitadf811644540e0d5702337eeceb95d0b8a7bc4ff (patch)
treebc201c0e6d3e0fb4168cea4d8681f9833bd58763 /sh
parentdhcpcd: Avoid calling start-stop-daemon (diff)
downloadnetifrc-adf811644540e0d5702337eeceb95d0b8a7bc4ff.tar.gz
netifrc-adf811644540e0d5702337eeceb95d0b8a7bc4ff.tar.bz2
netifrc-adf811644540e0d5702337eeceb95d0b8a7bc4ff.zip
Do not call exit with a negative value
This is undefined in POSIX.
Diffstat (limited to 'sh')
-rw-r--r--sh/functions.sh4
-rw-r--r--sh/systemd-wrapper.sh.in9
2 files changed, 6 insertions, 7 deletions
diff --git a/sh/functions.sh b/sh/functions.sh
index 368bb73..0048a5f 100644
--- a/sh/functions.sh
+++ b/sh/functions.sh
@@ -12,7 +12,7 @@ elif [ -f /lib/gentoo/functions.sh ]; then
else
echo "/lib/gentoo/functions.sh not found. Exiting"
- exit -1
+ exit 1
fi
# runscript functions
@@ -119,7 +119,7 @@ get_interface() {
printf ${RC_IFACE};;
*)
eerror "Init system not supported. Aborting"
- exit -1;;
+ exit 1;;
esac
}
diff --git a/sh/systemd-wrapper.sh.in b/sh/systemd-wrapper.sh.in
index d931200..b26f976 100644
--- a/sh/systemd-wrapper.sh.in
+++ b/sh/systemd-wrapper.sh.in
@@ -14,7 +14,7 @@ usage() {
die() {
echo "$@"
- exit -1
+ exit 1
}
while getopts "i:" opt; do
@@ -49,8 +49,7 @@ fi
if [ -f "$INITDIR/${RC_SVCPREFIX}.lo" ]; then
. "$INITDIR/${RC_SVCPREFIX}.lo"
else
- echo "$INITDIR/${RC_SVCPREFIX}.lo : Init file missing or invalid path"
- exit -1
+ die "$INITDIR/${RC_SVCPREFIX}.lo : Init file missing or invalid path"
fi
netifrc_init() {
@@ -58,13 +57,13 @@ netifrc_init() {
mkdir -p "$OPTIONSDIR"
if [ ! -w "$OPTIONSDIR" ]; then
eerror "${OPTIONSDIR} does not exist or is not writeable"
- exit -1;
+ exit 1
fi
# Ensure STATEDIR is present and writeable
mkdir -p "$STATEDIR"
if [ ! -w "$STATEDIR" ]; then
eerror "${STATEDIR} does not exist or is not writeable"
- exit -1;
+ exit 1
fi
}