rc.subr (222996) | rc.subr (223227) |
---|---|
1# $NetBSD: rc.subr,v 1.67 2006/10/07 11:25:15 elad Exp $ | 1# $NetBSD: rc.subr,v 1.67 2006/10/07 11:25:15 elad Exp $ |
2# $FreeBSD: head/etc/rc.subr 222996 2011-06-11 21:40:37Z hrs $ | 2# $FreeBSD: head/etc/rc.subr 223227 2011-06-18 11:05:30Z jilles $ |
3# 4# Copyright (c) 1997-2004 The NetBSD Foundation, Inc. 5# All rights reserved. 6# 7# This code is derived from software contributed to The NetBSD Foundation 8# by Luke Mewburn. 9# 10# Redistribution and use in source and binary forms, with or without --- 1046 unchanged lines hidden (view full) --- 1057 fi 1058 if [ -f /etc/rc.conf.d/"$_name" ]; then 1059 debug "Sourcing /etc/rc.conf.d/${_name}" 1060 . /etc/rc.conf.d/"$_name" 1061 fi 1062 1063 # Set defaults if defined. 1064 for _var in $rcvar $rcvars; do | 3# 4# Copyright (c) 1997-2004 The NetBSD Foundation, Inc. 5# All rights reserved. 6# 7# This code is derived from software contributed to The NetBSD Foundation 8# by Luke Mewburn. 9# 10# Redistribution and use in source and binary forms, with or without --- 1046 unchanged lines hidden (view full) --- 1057 fi 1058 if [ -f /etc/rc.conf.d/"$_name" ]; then 1059 debug "Sourcing /etc/rc.conf.d/${_name}" 1060 . /etc/rc.conf.d/"$_name" 1061 fi 1062 1063 # Set defaults if defined. 1064 for _var in $rcvar $rcvars; do |
1065 _defval=`eval echo "\\\$${_var}_defval"` | 1065 eval _defval=\$${_var}_defval |
1066 if [ -n "$_defval" ]; then 1067 eval : \${$_var:=\$${_var}_defval} 1068 fi 1069 done 1070 1071 # check obsolete rc.conf variables 1072 for _var in $rcvars_obsolete; do | 1066 if [ -n "$_defval" ]; then 1067 eval : \${$_var:=\$${_var}_defval} 1068 fi 1069 done 1070 1071 # check obsolete rc.conf variables 1072 for _var in $rcvars_obsolete; do |
1073 _v=`eval echo \\$$_var` 1074 _msg=`eval echo \\$${_var}_obsolete_msg` 1075 _new=`eval echo \\$${_var}_newvar` | 1073 eval _v=\$$_var 1074 eval _msg=\$${_var}_obsolete_msg 1075 eval _new=\$${_var}_newvar |
1076 case $_v in 1077 "") 1078 ;; 1079 *) 1080 if [ -z "$_new" ]; then 1081 _msg="Ignored." 1082 else 1083 eval $_new=\"\$$_var\" --- 676 unchanged lines hidden (view full) --- 1760# mode=0: Echo $msg if ${$var} is empty. 1761# After doing echo, a string is set to ${$var}. 1762# 1763# mode=1: Echo $msg if ${$var} is a string with non-zero length. 1764# 1765_echoonce() 1766{ 1767 local _var _msg _mode | 1076 case $_v in 1077 "") 1078 ;; 1079 *) 1080 if [ -z "$_new" ]; then 1081 _msg="Ignored." 1082 else 1083 eval $_new=\"\$$_var\" --- 676 unchanged lines hidden (view full) --- 1760# mode=0: Echo $msg if ${$var} is empty. 1761# After doing echo, a string is set to ${$var}. 1762# 1763# mode=1: Echo $msg if ${$var} is a string with non-zero length. 1764# 1765_echoonce() 1766{ 1767 local _var _msg _mode |
1768 _var=`eval echo \\$$1` | 1768 eval _var=\$$1 |
1769 _msg=$2 1770 _mode=$3 1771 1772 case $_mode in 1773 1) [ -n "$_var" ] && echo "$_msg" ;; 1774 *) [ -z "$_var" ] && echo -n "$_msg" && eval "$1=finished" ;; 1775 esac 1776} 1777 1778_rc_subr_loaded=: | 1769 _msg=$2 1770 _mode=$3 1771 1772 case $_mode in 1773 1) [ -n "$_var" ] && echo "$_msg" ;; 1774 *) [ -z "$_var" ] && echo -n "$_msg" && eval "$1=finished" ;; 1775 esac 1776} 1777 1778_rc_subr_loaded=: |