Masato Taruishi
taru****@users*****
2004年 9月 17日 (金) 19:55:57 JST
=================================================================== RCS file: ultrapossum/init.d/10config,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ultrapossum/init.d/10config 2004/09/16 07:40:28 1.3 +++ ultrapossum/init.d/10config 2004/09/17 10:55:57 1.4 @@ -102,25 +102,29 @@ ldap) ;; *) - if test -f "$MODULECONFDIR/$1.cf"; then - fs="$MODULECONFDIR/$1.cf" - fi - if test "x$EXTRACONFSUFFIX" != "x" && test -f "$MODULECONFDIR/$1.cf$EXTRACONFSUFFIX"; then - fs="$fs $MODULECONFDIR/$1.cf$EXTRACONFSUFFIX" - fi - - for f in $fs; do - if test -r "$f"; then - cat $f - else - echo "Warning: no permission to read $f" 1>&2 - fi - done - - ;; + ultrapossum_parse_config_shell "$MODULECONFDIR/$1.cf" + ;; esac } + +# ultrapossum_parse_config_shell <path> +ultrapossum_parse_config_shell() { + if test -f "$1"; then + fs="$1" + fi + if test "x$EXTRACONFSUFFIX" != "x" && test -f "$1$EXTRACONFSUFFIX"; then + fs="$fs $1$EXTRACONFSUFFIX" + fi + for f in $fs; do + if test -r "$f"; then + cat $f + else + echo "Warning: no permission to read $f" 1>&2 + fi + done +} + # retrieve the known variables # getvariable [<module>...] =================================================================== RCS file: ultrapossum/init.d/15variable,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ultrapossum/init.d/15variable 2004/09/16 13:46:44 1.2 +++ ultrapossum/init.d/15variable 2004/09/17 10:55:57 1.3 @@ -19,63 +19,22 @@ . $CACHEDIR/$cache fi ## cache -if test "x$ULTRAPOSSUMDEFAULT" = "x"; then - if test -f "$ULTRAPOSSUMCF"; then - . $ULTRAPOSSUMCF - fi - if test "x$EXTRACONFSUFFIX" != "x" && - test -f "$ULTRAPOSSUMCF$EXTRACONFSUFFIX" - then - . $ULTRAPOSSUMCF$EXTRACONFSUFFIX - fi +# move to config backend framework? +case "$ULTRAPOSSUM_CONFIG_BACKEND" in + ldap) + : + ;; + *) + eval "`ultrapossum_parse_config_shell "$ULTRAPOSSUMCF"`" + eval "`ultrapossum_parse_config_shell "$SYSCONFDIR/secret.cf"`" + ;; +esac - if test -r "$SYSCONFDIR/secret.cf"; then - . $SYSCONFDIR/secret.cf - fi - if test "x$EXTRACONFSUFFIX" != "x" && - test -r "$SYSCONFDIR/secret.cf$EXTRACONFSUFFIX" - then - . $SYSCONFDIR/secret.cf$EXTRACONFSUFFIX - fi - - if test -d $APPSCONFDIR; then - for f in `find $APPSCONFDIR -name '*.cf'` - do - if test -f $f; then - cfs="$cfs $f" - fi - done - for f in `find $APPSCONFDIR -name "*.cf$EXTRACONFSUFFIX"` - do - if test -f $f; then - cfs="$cfs $f" - fi - done - fi - - if test -f "$SYSCONFDIR/projects/$ULTRAPOSSUM_PROJECT"; then - . $SYSCONFDIR/projects/$ULTRAPOSSUM_PROJECT - fi - if test "x$EXTRACONFSUFFIX" != "x" && - test -f "$SYSCONFDIR/projects/$ULTRAPOSSUM_PROJECT$EXTRACONFSUFFIX" - then - . $SYSCONFDIR/projects/$ULTRAPOSSUM_PROJECT$EXTRACONFSUFFIX - fi - - if test "x$cfs" != "x"; then - for cf in $cfs - do - if test -f "$cf"; then - if test -r "$cf"; then - verbose -n "Using $cf... " - . $cf - verbose "done" - else - echo "Warning: no permission to read $cf" 1>&2 - fi - else - echo "W: $cf not found" 1>&2 - fi - done - fi +if test -d $APPSCONFDIR; then + for f in `find $APPSCONFDIR -name '*.cf'` + do + eval "`ultrapossum_parse_config_shell "$f"`" + done fi + +eval "`ultrapossum_parse_config_shell "$SYSCONFDIR/projects/$ULTRAPOSSUM_PROJECT"`"