summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@orbis-terrarum.net>2015-01-19 00:54:39 -0800
committerRobin H. Johnson <robbat2@orbis-terrarum.net>2015-01-19 00:54:39 -0800
commitea4b01b115ba3501073c326099e9c6f89de4c3af (patch)
treeb81c84ff0018831d08df74a036d2b930cc54f23a
parentMerge pull request #5 from dwfreed/master (diff)
parentDo not call exit with a negative value (diff)
downloadnetifrc-ea4b01b115ba3501073c326099e9c6f89de4c3af.tar.gz
netifrc-ea4b01b115ba3501073c326099e9c6f89de4c3af.tar.bz2
netifrc-ea4b01b115ba3501073c326099e9c6f89de4c3af.zip
Merge pull request #6 from floppym/fixes1
Miscellaneous fixes
-rw-r--r--init.d/net.lo.in2
-rw-r--r--net/dhcpcd.sh5
-rw-r--r--sh/functions.sh4
-rw-r--r--sh/systemd-wrapper.sh.in9
-rw-r--r--systemd/net_at.service.in3
5 files changed, 10 insertions, 13 deletions
diff --git a/init.d/net.lo.in b/init.d/net.lo.in
index c79e7ff..e9e7f7c 100644
--- a/init.d/net.lo.in
+++ b/init.d/net.lo.in
@@ -22,7 +22,7 @@ if [ -f "$SHDIR/functions.sh" ]; then
. "$SHDIR/functions.sh"
else
echo "$SHDIR/functions.sh missing. Exiting"
- exit -1
+ exit 1
fi
depend()
diff --git a/net/dhcpcd.sh b/net/dhcpcd.sh
index bdb60c6..c598083 100644
--- a/net/dhcpcd.sh
+++ b/net/dhcpcd.sh
@@ -82,10 +82,7 @@ dhcpcd_stop()
[ -z "${opts}" ] && opts=${dhcp}
case " ${opts} " in
*" release "*) dhcpcd -k "${IFACE}" ;;
- *)
- start-stop-daemon --stop --quiet \
- --signal ${sig} --pidfile "${pidfile}"
- ;;
+ *) dhcpcd -x "${IFACE}" ;;
esac
eend $?
}
diff --git a/sh/functions.sh b/sh/functions.sh
index d907585..34aaa27 100644
--- a/sh/functions.sh
+++ b/sh/functions.sh
@@ -11,7 +11,7 @@ elif [ -f /lib/gentoo/functions.sh ]; then
else
echo "/lib/gentoo/functions.sh not found. Exiting"
- exit -1
+ exit 1
fi
# runscript functions
@@ -120,7 +120,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
}
diff --git a/systemd/net_at.service.in b/systemd/net_at.service.in
index a729ec4..ac89899 100644
--- a/systemd/net_at.service.in
+++ b/systemd/net_at.service.in
@@ -1,7 +1,8 @@
[Unit]
-Description="Gentoo Network Interface Management Scripts"
+Description=Gentoo Network Interface Management Scripts
[Service]
+Type=oneshot
ExecStart=@LIBEXECDIR@/sh/systemd-wrapper.sh -i %I start
ExecStop=@LIBEXECDIR@/sh/systemd-wrapper.sh -i %I stop
RemainAfterExit=yes