summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/atm1
diff options
context:
space:
mode:
Diffstat (limited to 'etc/rc.d/atm1')
-rw-r--r--etc/rc.d/atm1105
1 files changed, 16 insertions, 89 deletions
diff --git a/etc/rc.d/atm1 b/etc/rc.d/atm1
index 1c53c7f..0272642 100644
--- a/etc/rc.d/atm1
+++ b/etc/rc.d/atm1
@@ -27,13 +27,25 @@
# $FreeBSD$
#
-#
+# PROVIDE: atm1
+# REQUIRE: root
+# BEFORE: network1
+# KEYWORD: FreeBSD
+
+. /etc/rc.subr
+
+name="atm"
+rcvar="atm_enable"
+start_cmd="atm_start"
+stop_cmd=":"
+
# ATM networking startup script
#
# Initial interface configuration.
# N.B. /usr is not mounted.
#
-atm_pass1() {
+start_cmd()
+{
# Locate all probed ATM adapters
atmdev=`atm sh stat int | while read dev junk; do
case ${dev} in
@@ -126,92 +138,7 @@ atm_pass1() {
esac
echo '.'
- atm_pass1_done=YES
}
-#
-# Finish up configuration.
-# N.B. /usr is not mounted.
-#
-atm_pass2() {
- echo -n 'Configuring ATM network interfaces:'
-
- atm_scspd=0
- atm_atmarpd=""
-
- # Configure network interfaces
- for phy in ${atm_phy}; do
- eval netif_args=\$atm_netif_${phy}
- set -- ${netif_args}
- netname=$1
- netcnt=$2
- netindx=0
- while [ ${netindx} -lt ${netcnt} ]; do
- net="${netname}${netindx}"
- netindx=$((${netindx} + 1))
- echo -n " ${net}"
-
- # Configure atmarp server
- eval atmarp_args=\$atm_arpserver_${net}
- if [ -n "${atmarp_args}" ]; then
- atm set arpserver ${net} ${atmarp_args} ||
- continue
- fi
- eval scsparp_args=\$atm_scsparp_${net}
-
- case ${scsparp_args} in
- [Yy][Ee][Ss])
- case ${atmarp_args} in
- local)
- ;;
- *)
- echo ' local arpserver required for SCSP'
- continue
- ;;
- esac
-
- atm_atmarpd="${atm_atmarpd} ${net}"
- atm_scspd=1
- esac
- done
- done
- echo '.'
-
- # Define any PVCs.
- if [ -n "${atm_pvcs}" ]; then
- for i in ${atm_pvcs}; do
- eval pvc_args=\$atm_pvc_${i}
- atm add pvc ${pvc_args}
- done
- fi
-
- # Define any permanent ARP entries.
- if [ -n "${atm_arps}" ]; then
- for i in ${atm_arps}; do
- eval arp_args=\$atm_arp_${i}
- atm add arp ${arp_args}
- done
- fi
- atm_pass2_done=YES
-}
-
-#
-# Start any necessary daemons.
-#
-atm_pass3() {
- # Start SCSP daemon (if needed)
- case ${atm_scspd} in
- 1)
- echo -n ' scspd'
- scspd
- ;;
- esac
-
- # Start ATMARP daemon (if needed)
- if [ -n "${atm_atmarpd}" ]; then
- echo -n ' atmarpd'
- atmarpd ${atm_atmarpd}
- fi
-
- atm_pass3_done=YES
-}
+load_rc_config $name
+run_rc_command "$1"
OpenPOWER on IntegriCloud