[Zrouter-src] ZRouter.org: push to ZRouter profiles/SMALL_/files/etc/rc.d/swit...

zrouter-src at zrouter.org zrouter-src at zrouter.org
Thu Sep 20 12:54:11 UTC 2012


details:   http://zrouter.org/hg/zrouter//rev/127789042ff9
changeset: 442:127789042ff9
user:      Aleksandr Rybalko <ray at ddteam.net>
date:      Thu Sep 20 15:32:53 2012 +0300
description:
Add standard rc.d script to control board switch ports.

diffstat:

 profiles/SMALL_/files/etc/rc.d/switchctl |  39 ++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diffs (44 lines):

diff -r b64397976284 -r 127789042ff9 profiles/SMALL_/files/etc/rc.d/switchctl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/SMALL_/files/etc/rc.d/switchctl	Thu Sep 20 15:32:53 2012 +0300
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# BEFORE: ADAPTATION
+# PROVIDE: switchctl
+
+. /etc/rc.subr
+. /etc/network.subr
+
+name="switchctl"
+start_cmd="switchctl_start"
+extra_commands="enablelan disablelan"
+enablelan_cmd="enablelan_sub"
+disablelan_cmd="disablelan_sub"
+
+switchctl_start()
+{
+	# disable LAN ports until LAN iface will be configured
+	if [ -x /etc/rc.d/bd_switchctl ] ; then
+		/etc/rc.d/bd_switchctl disablelan;
+	fi
+}
+
+disablelan_sub()
+{
+	if [ -x /etc/rc.d/bd_switchctl ] ; then
+		/etc/rc.d/bd_switchctl disablelan;
+	fi
+}
+
+enablelan_sub()
+{
+	if [ -x /etc/rc.d/bd_switchctl ] ; then
+		/etc/rc.d/bd_switchctl enablelan;
+	fi
+}
+
+load_rc_config $name
+
+run_rc_command $*
\ No newline at end of file


More information about the Zrouter-src mailing list