diff options
author | gordon <gordon@FreeBSD.org> | 2002-05-18 00:26:10 +0000 |
---|---|---|
committer | gordon <gordon@FreeBSD.org> | 2002-05-18 00:26:10 +0000 |
commit | feb720dec591489f53df48c52dcc0dbff33c4112 (patch) | |
tree | 6280b1cdfbf53d1133c74921ab74c11151c24a63 | |
parent | fff8069519989b3200f33093f1fc01a0f672ccb0 (diff) | |
download | FreeBSD-src-feb720dec591489f53df48c52dcc0dbff33c4112.zip FreeBSD-src-feb720dec591489f53df48c52dcc0dbff33c4112.tar.gz |
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
-rw-r--r-- | etc/rc.shutdown | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/etc/rc.shutdown b/etc/rc.shutdown index 6a7ca8a..25c1e42 100644 --- a/etc/rc.shutdown +++ b/etc/rc.shutdown @@ -52,6 +52,18 @@ elif [ -r /etc/rc.conf ]; then . /etc/rc.conf 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 # case ${entropy_file} in @@ -109,13 +121,13 @@ case ${local_startup} in for dir in ${local_startup}; do if [ -d "${dir}" ]; then for script in ${dir}/*.sh; do - slist="${script}${script_name_sep}${slist}" + slist="${slist}${script_name_sep}${script}" done fi done script_save_sep="$IFS" IFS="${script_name_sep}" - for script in ${slist}; do + for script in `reverse_list ${slist}`; do if [ -x "${script}" ]; then (set -T trap 'exit 1' 2 |