2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# conffile.sh - handle configuration files
|
2007-09-23 08:04:48 +00:00
|
|
|
# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org>
|
|
|
|
#
|
|
|
|
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
|
|
|
# This is free software, and you are welcome to redistribute it
|
|
|
|
# under certain conditions; see COPYING for details.
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
Read_conffile ()
|
|
|
|
{
|
2007-09-23 08:04:49 +00:00
|
|
|
FILE="${1}"
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:04:49 +00:00
|
|
|
if [ -f "${FILE}" ]
|
2007-09-23 08:04:46 +00:00
|
|
|
then
|
2007-09-23 08:04:49 +00:00
|
|
|
if [ -r "${FILE}" ]
|
2007-09-23 08:04:47 +00:00
|
|
|
then
|
2007-09-23 08:04:49 +00:00
|
|
|
Echo_debug "Reading configuration file ${FILE}"
|
|
|
|
. "${FILE}"
|
2007-09-23 08:04:47 +00:00
|
|
|
else
|
2007-09-23 08:04:49 +00:00
|
|
|
Echo_warning "Failed to read configuration file ${FILE}"
|
2007-09-23 08:04:47 +00:00
|
|
|
fi
|
2007-09-23 08:04:46 +00:00
|
|
|
fi
|
|
|
|
}
|