Fix the order of shutdown scripts so it not only reverses the order of the
files in each ${local_startup} directory, it also reverses the order of the directories. Suggested by: jhb Reviewed by: jake Approved by: dougb MFC after: 1 week
This commit is contained in:
parent
ef446fb2c6
commit
6395b411cb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96830
@ -52,6 +52,18 @@ elif [ -r /etc/rc.conf ]; then
|
|||||||
. /etc/rc.conf
|
. /etc/rc.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# reverse_list list
|
||||||
|
# print the list in reverse order
|
||||||
|
#
|
||||||
|
reverse_list()
|
||||||
|
{
|
||||||
|
_revlist=
|
||||||
|
for _revfile in $*; do
|
||||||
|
_revlist="$_revfile${script_name_sep}$_revlist"
|
||||||
|
done
|
||||||
|
echo $_revlist
|
||||||
|
}
|
||||||
|
|
||||||
# Write some entropy so the rebooting /dev/random can reseed
|
# Write some entropy so the rebooting /dev/random can reseed
|
||||||
#
|
#
|
||||||
case ${entropy_file} in
|
case ${entropy_file} in
|
||||||
@ -109,13 +121,13 @@ case ${local_startup} in
|
|||||||
for dir in ${local_startup}; do
|
for dir in ${local_startup}; do
|
||||||
if [ -d "${dir}" ]; then
|
if [ -d "${dir}" ]; then
|
||||||
for script in ${dir}/*.sh; do
|
for script in ${dir}/*.sh; do
|
||||||
slist="${script}${script_name_sep}${slist}"
|
slist="${slist}${script_name_sep}${script}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
script_save_sep="$IFS"
|
script_save_sep="$IFS"
|
||||||
IFS="${script_name_sep}"
|
IFS="${script_name_sep}"
|
||||||
for script in ${slist}; do
|
for script in `reverse_list ${slist}`; do
|
||||||
if [ -x "${script}" ]; then
|
if [ -x "${script}" ]; then
|
||||||
(set -T
|
(set -T
|
||||||
trap 'exit 1' 2
|
trap 'exit 1' 2
|
||||||
|
Loading…
Reference in New Issue
Block a user