changeset 442:127789042ff9

Add standard rc.d script to control board switch ports.
author Aleksandr Rybalko <ray@ddteam.net>
date Thu, 20 Sep 2012 15:32:53 +0300
parents b64397976284
children eddcdc561685
files profiles/SMALL_/files/etc/rc.d/switchctl
diffstat 1 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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