summaryrefslogtreecommitdiff
path: root/functions/templates.sh
diff options
context:
space:
mode:
Diffstat (limited to 'functions/templates.sh')
-rwxr-xr-xfunctions/templates.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/functions/templates.sh b/functions/templates.sh
new file mode 100755
index 0000000..927c39f
--- /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
+}