summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2015-11-02 22:06:44 +0000
committerdteske <dteske@FreeBSD.org>2015-11-02 22:06:44 +0000
commitf8f428460f83b13e61a8c2cc58e07407179cf3ff (patch)
treec45f0cc3b91311b1212af810402547b8d735dc01 /usr.sbin
parent9d735decd6668a1762d3c2f6bdf1b5efd9440b0c (diff)
downloadFreeBSD-src-f8f428460f83b13e61a8c2cc58e07407179cf3ff.zip
FreeBSD-src-f8f428460f83b13e61a8c2cc58e07407179cf3ff.tar.gz
MFC r287690: Produce meaningful exit code
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv410
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv610
2 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
index 856c999..88a0fa2 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv4
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -80,16 +80,20 @@ echo $INTERFACE $IF_CONFIG |
printf("ifconfig_%s=\"%s\inet %s netmask %s\"\n", $1, prefix, $2, $3);
printf("defaultrouter=\"%s\"\n", $4);
}' >> $BSDINSTALL_TMPETC/._rc.conf.net
+retval=$?
-if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
. $BSDINSTALL_TMPETC/._rc.conf.net
ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE`
- if [ -n "${defaultrouter}" ]; then
+ if [ "$defaultrouter" ]; then
route delete -inet default
route add -inet default $defaultrouter
+ retval=$?
fi
fi
+exit $retval
+
################################################################################
# END
################################################################################
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv6 b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
index aa1a579..ff4258f 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv6
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
@@ -2,7 +2,7 @@
#-
# Copyright (c) 2011 Nathan Whitehorn
# Copyright (c) 2011 The FreeBSD Foundation
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Portions of this software were developed by Bjoern Zeeb
@@ -141,16 +141,20 @@ BEGIN {
}
printf("ifconfig_%s_ipv6=\"inet6 %s\"\n", iface, $1);
}' >> $BSDINSTALL_TMPETC/._rc.conf.net
+retval=$?
-if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
. $BSDINSTALL_TMPETC/._rc.conf.net
ifconfig ${INTERFACE} `eval echo \\\$ifconfig_${INTERFACE}_ipv6`
- if [ -n "${ipv6_defaultrouter}" ]; then
+ if [ "$ipv6_defaultrouter" ]; then
route delete -inet6 default
route add -inet6 default ${ipv6_defaultrouter}
+ retval=$?
fi
fi
+exit $retval
+
################################################################################
# END
################################################################################
OpenPOWER on IntegriCloud