summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedikt Boehm <hollow@gentoo.org>2005-10-09 08:31:20 +0000
committerBenedikt Boehm <hollow@gentoo.org>2005-10-09 08:31:20 +0000
commit53c0ee2f8b484270b6ad60d53c5f7247e9a428db (patch)
tree693a49c846b08b89cc2c784dc692dd44904ed2ec /net-scripts/net.modules.d/helpers.d/dhcp-state
parentRefreshing baselayout-vserver with revision 1560 from baselayout. (diff)
downloadbaselayout-vserver-53c0ee2f8b484270b6ad60d53c5f7247e9a428db.tar.gz
baselayout-vserver-53c0ee2f8b484270b6ad60d53c5f7247e9a428db.tar.bz2
baselayout-vserver-53c0ee2f8b484270b6ad60d53c5f7247e9a428db.zip
add back net services
svn path=/baselayout-vserver/trunk/; revision=52
Diffstat (limited to 'net-scripts/net.modules.d/helpers.d/dhcp-state')
-rw-r--r--net-scripts/net.modules.d/helpers.d/dhcp-state31
1 files changed, 31 insertions, 0 deletions
diff --git a/net-scripts/net.modules.d/helpers.d/dhcp-state b/net-scripts/net.modules.d/helpers.d/dhcp-state
new file mode 100644
index 0000000..8bc2681
--- /dev/null
+++ b/net-scripts/net.modules.d/helpers.d/dhcp-state
@@ -0,0 +1,31 @@
+#!/bin/bash
+# Copyright (c) 2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Contributed by Roy Marples (uberlord@gentoo.org)
+
+MODULES_DIR="/lib/rcscripts/net.modules.d"
+. /lib/rcscripts/sh/rc-services.sh
+. "${MODULES_DIR}/helpers.d/functions"
+conf=$(add_suffix "/etc/conf.d/net")
+[[ -e ${conf} ]] && source "${conf}"
+
+service="net.${interface}"
+
+if [[ ${action} != "up" ]]; then
+ if service_starting "${service}" || service_started "${service}" ; then
+ mark_service_inactive "${service}"
+ fi
+ remove_state "${interface}" false
+else
+ ! service_stopping "${service}" && mark_service_started "${service}"
+fi
+
+if [[ ${RC_AUTO_INTERFACE} == "yes" ]]; then
+ best_interface=$( select_best_interface )
+ apply_state "${best_interface}"
+elif [[ ${action} == "up" ]]; then
+ apply_state "${interface}"
+fi
+
+# vim:ts=4