diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:05:13 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:22:25 +0100 |
commit | cd5110f6b8eb77519d704972276cfd5be6bff055 (patch) | |
tree | 3bc1bcdbff4ec3bd5a82ae34d9efed47b157e3e0 /functions/templates.sh | |
parent | fdef63e60c2e68226da2fe92d6cc393c1af2b801 (diff) | |
download | vyos-live-build-cd5110f6b8eb77519d704972276cfd5be6bff055.tar.gz vyos-live-build-cd5110f6b8eb77519d704972276cfd5be6bff055.zip |
Adding live-helper 1.0~a17-1.
Diffstat (limited to 'functions/templates.sh')
-rwxr-xr-x | functions/templates.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/functions/templates.sh b/functions/templates.sh new file mode 100755 index 000000000..927c39ffd --- /dev/null +++ b/functions/templates.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# templates.sh - handle templates files +# Copyright (C) 2007 Otavio Salvador <otavio@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. + +set -e + +Check_templates () +{ + PROGRAM="${1}" + + # Check local templates + if [ -d config/templates/"${PROGRAM}" ] + then + LIVE_TEMPLATES="config/templates" + 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}" ] + then + Echo_error "${PROGRAM} templates not accessible in ${LIVE_TEMPLATES}" + exit 1 + fi +} |