aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian S. Dean <bsd@FreeBSD.org>2000-12-13 19:17:54 +0000
committerBrian S. Dean <bsd@FreeBSD.org>2000-12-13 19:17:54 +0000
commit3306abc4593f4e4e4619801f83ac2305a152de17 (patch)
tree7911090c09168f54e97eabb6dd063e7fac6920df
parent05f9877c154a641762f0f16f48c4e73898fbba77 (diff)
downloadsrc-3306abc4593f4e4e4619801f83ac2305a152de17.tar.gz
src-3306abc4593f4e4e4619801f83ac2305a152de17.zip
Flesh out a simple framework for dependency checking rc.conf enabled
services. Simple YES/NO style *_enable services are supported. Reviewed by: obrien
Notes
Notes: svn path=/head/; revision=69988
-rw-r--r--etc/rc42
1 files changed, 19 insertions, 23 deletions
diff --git a/etc/rc b/etc/rc
index d9de5eda0bd9..6072cc316fe8 100644
--- a/etc/rc
+++ b/etc/rc
@@ -71,36 +71,32 @@ elif [ -r /etc/rc.conf ]; then
. /etc/rc.conf
fi
-# Deal with dependancies.
- case ${amd_enable} in
+chkdepend() {
+ svc=$1
+ svc_var=$2
+ dep=$3
+ dep_var=$4
+
+ eval svc_val=\${$svc_var}
+ eval dep_val=\${$dep_var}
+
+ case ${svc_val} in
[Yy][Ee][Ss])
- case ${portmap_enable} in
+ case ${dep_val} in
[Yy][Ee][Ss])
- ;;
+ ;;
*)
- portmap_enable="YES"
- echo "DEPENDENCY NOTE: portmap will be enabled" \
- "to support amd"
- ;;
+ eval ${dep_var}="YES"
+ echo "DEPENDENCY NOTE: ${dep} will be enabled" \
+ "to support ${svc}"
+ ;;
esac
;;
esac
- case ${nfs_server_enable} in
- [Yy][Ee][Ss])
- if [ -r /etc/exports ]; then
- case ${portmap_enable} in
- [Yy][Ee][Ss])
- ;;
- *)
- portmap_enable="YES"
- echo "DEPENDENCY NOTE: portmap will be enabled" \
- "to support NFS"
- ;;
- esac
- fi
- ;;
- esac
+}
+chkdepend amd amd_enable portmap portmap_enable
+chkdepend NFS nfs_server_enable portmap portmap_enable
# First pass at entropy recovery so the rebooting /dev/random can reseed.
#