diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:05:15 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:22:26 +0100 |
commit | c79ab34a7c597c9e3ab202c644121c6944789424 (patch) | |
tree | 324691f4f851c719b864229b399584f035b2873f /functions/templates.sh | |
parent | 0d5ff4ca7596790f853cf637e0fe225cad810a76 (diff) | |
download | vyos-live-build-c79ab34a7c597c9e3ab202c644121c6944789424.tar.gz vyos-live-build-c79ab34a7c597c9e3ab202c644121c6944789424.zip |
Adding live-helper 1.0~a19-1.
Diffstat (limited to 'functions/templates.sh')
-rwxr-xr-x | functions/templates.sh | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/functions/templates.sh b/functions/templates.sh index 9fbc36549..6b60c9e9a 100755 --- a/functions/templates.sh +++ b/functions/templates.sh @@ -11,22 +11,25 @@ set -e Check_templates () { - PROGRAM="${1}" + ITEM="${1}" - # Check local templates - if [ -d config/templates/"${PROGRAM}" ] + # Check user defined templates directory + if [ ! -d "${LIVE_TEMPLATES}" ] then - LIVE_TEMPLATES="config/templates" + if [ -d config/templates ] + then + LIVE_TEMPLATES=config/templates + else + Echo_error "templates not accessible in ${LIVE_TEMPLATES} nor config/templates" + exit 1 + fi fi - # Checking user templates - if [ ! -d "${LIVE_TEMPLATES}" ] - then - Echo_error "user specified templates not accessible in ${LIVE_TEMPLATES}" - exit 1 - elif [ ! -d "${LIVE_TEMPLATES}/${PROGRAM}" ] + if [ -d "${LIVE_TEMPLATES}/${ITEM}" ] then - Echo_error "${PROGRAM} templates not accessible in ${LIVE_TEMPLATES}" + TEMPLATES="${LIVE_TEMPLATES}/${ITEM}" + else + Echo_error "${ITEM} templates not accessible in ${LIVE_TEMPLATES}" exit 1 fi } |