NetBSD rev. 1.53, 1.54 and 1.55:
Change how internal boolean variables are used to: if ! ${_somevar:-false}; then _somevar=true fi (Consisent, slightly quicker, and slightly cleaner) Obtained from: NetBSD
This commit is contained in:
parent
fd63c5b3a2
commit
4585b18227
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126285
18
etc/rc.subr
18
etc/rc.subr
@ -163,13 +163,15 @@ mount_critical_filesystems()
|
|||||||
eval _fslist=\$critical_filesystems_${1}
|
eval _fslist=\$critical_filesystems_${1}
|
||||||
for _fs in $_fslist; do
|
for _fs in $_fslist; do
|
||||||
mount | (
|
mount | (
|
||||||
_ismounted=no
|
_ismounted=false
|
||||||
while read what _on on _type type; do
|
while read what _on on _type type; do
|
||||||
if [ $on = $_fs ]; then
|
if [ $on = $_fs ]; then
|
||||||
_ismounted=yes
|
_ismounted=true
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ $_ismounted = no ]; then
|
if $_ismounted; then
|
||||||
|
:
|
||||||
|
else
|
||||||
mount $_fs >/dev/null 2>&1
|
mount $_fs >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
@ -742,10 +744,10 @@ $command $rc_flags $command_args"
|
|||||||
# prevent restart being called more
|
# prevent restart being called more
|
||||||
# than once by any given script
|
# than once by any given script
|
||||||
#
|
#
|
||||||
if [ -n "$_rc_restart_done" ]; then
|
if ${_rc_restart_done:-false}; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
_rc_restart_done=YES
|
_rc_restart_done=true
|
||||||
|
|
||||||
( $0 ${rc_force:+force}stop )
|
( $0 ${rc_force:+force}stop )
|
||||||
$0 ${rc_force:+force}start
|
$0 ${rc_force:+force}start
|
||||||
@ -840,7 +842,9 @@ load_rc_config()
|
|||||||
err 3 'USAGE: load_rc_config command'
|
err 3 'USAGE: load_rc_config command'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$_rc_conf_loaded" ]; then
|
if ${_rc_conf_loaded:-false}; then
|
||||||
|
:
|
||||||
|
else
|
||||||
if [ -r /etc/defaults/rc.conf ]; then
|
if [ -r /etc/defaults/rc.conf ]; then
|
||||||
debug "Sourcing /etc/defaults/rc.conf"
|
debug "Sourcing /etc/defaults/rc.conf"
|
||||||
. /etc/defaults/rc.conf
|
. /etc/defaults/rc.conf
|
||||||
@ -849,7 +853,7 @@ load_rc_config()
|
|||||||
debug "Sourcing /etc/rc.conf (/etc/defaults/rc.conf doesn't exist)."
|
debug "Sourcing /etc/rc.conf (/etc/defaults/rc.conf doesn't exist)."
|
||||||
. /etc/rc.conf
|
. /etc/rc.conf
|
||||||
fi
|
fi
|
||||||
_rc_conf_loaded=YES
|
_rc_conf_loaded=true
|
||||||
fi
|
fi
|
||||||
if [ -f /etc/rc.conf.d/"$_command" ]; then
|
if [ -f /etc/rc.conf.d/"$_command" ]; then
|
||||||
debug "Sourcing /etc/rc.conf.d/${_command}"
|
debug "Sourcing /etc/rc.conf.d/${_command}"
|
||||||
|
Loading…
Reference in New Issue
Block a user