# Copyright © 2012  Roger Leigh <rleigh@debian.org>
#
# schroot is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# schroot is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see
# <http://www.gnu.org/licenses/>.
#
#####################################################################

# Common configuration for use in schroot setup scripts

# Source setup.config if set
if [ -n "${SETUP_CONFIG}" ]; then
    SETUP_CONFIG="${SYSCONF_DIR}/${SETUP_CONFIG}"
    if [ -f "$SETUP_CONFIG" ]; then
	. "$SETUP_CONFIG"
    fi
fi
# Source script-config if set.  If the file is no longer present
# (likely for upgrades), then set the defaults here.
if [ -n "$CHROOT_SCRIPT_CONFIG" ]; then
    FSTAB="$(dirname "$CHROOT_SCRIPT_CONFIG")/fstab"
    COPYFILES="$(dirname "$CHROOT_SCRIPT_CONFIG")/copyfiles"
    NSSDATABASES="$(dirname "$CHROOT_SCRIPT_CONFIG")/nssdatabases"
    if [ -f "$CHROOT_SCRIPT_CONFIG" ]; then
	. "$CHROOT_SCRIPT_CONFIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FIG"FI