summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
Diffstat (limited to 'etc/rc.d')
-rwxr-xr-xetc/rc.d/netif43
1 files changed, 34 insertions, 9 deletions
diff --git a/etc/rc.d/netif b/etc/rc.d/netif
index d623503..7aac42d 100755
--- a/etc/rc.d/netif
+++ b/etc/rc.d/netif
@@ -38,7 +38,8 @@ start_cmd="network_start"
stop_cmd="network_stop"
cloneup_cmd="clone_up"
clonedown_cmd="clone_down"
-extra_commands="cloneup clonedown"
+clear_cmd="doclear"
+extra_commands="cloneup clonedown clear"
cmdifn=
set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces
@@ -60,18 +61,15 @@ network_start()
# disable SIGINT (Ctrl-c) when running at startup
trap : 2
- # Create cloned interfaces
- clone_up
-
# Create Fast EtherChannel interfaces
fec_up
+ fi
- # Create IPv6<-->IPv4 tunnels
- gif_up
+ # Create cloned interfaces
+ clone_up $cmdifn
- # Rename interfaces.
- ifnet_rename
- fi
+ # Rename interfaces.
+ ifnet_rename $cmdifn
# Configure the interface(s).
network_common ifn_start
@@ -92,6 +90,18 @@ network_start()
network_stop()
{
+ _clone_down=1
+ network_stop0 $*
+}
+
+doclear()
+{
+ _clone_down=
+ network_stop0 $*
+}
+
+network_stop0()
+{
local _if
# Set the list of interfaces to work on.
@@ -101,6 +111,11 @@ network_stop()
# Deconfigure the interface(s)
network_common ifn_stop
+ # Destroy cloned interfaces
+ if [ -n "$_clone_down" ]; then
+ clone_down $cmdifn
+ fi
+
if [ -f /etc/rc.d/routing -a -n "$cmdifn" ] ; then
for _if in $cmdifn; do
/etc/rc.d/routing stop any $_if
@@ -142,6 +157,16 @@ network_common()
_fail=
_ok=
for ifn in ${_cooked_list}; do
+ # Skip if ifn does not exist.
+ case $_func in
+ ifn_stop)
+ if ! ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then
+ warn "$ifn does not exist. Skipped."
+ _fail="${_fail} ${ifn}"
+ continue
+ fi
+ ;;
+ esac
if ${_func} ${ifn} $2; then
_ok="${_ok} ${ifn}"
if ipv6if ${ifn}; then
OpenPOWER on IntegriCloud