Imported Upstream version 2.6.0
[debian/amanda] / common-src / amanda-sh-lib.sh.in
diff --git a/common-src/amanda-sh-lib.sh.in b/common-src/amanda-sh-lib.sh.in
new file mode 100644 (file)
index 0000000..0c82190
--- /dev/null
@@ -0,0 +1,49 @@
+# Shell library containing functions and definitions common to amanda's
+# shell scripts and wrappers.
+
+# Include this file as follows:
+#   prefix="@prefix@"
+#   exec_prefix="@exec_prefix@"
+#   amlibexecdir="@amlibexecdir@"
+#   . "${amlibexecdir}/amanda-sh-lib.sh"
+
+####
+# Configure variables
+
+GREP="@GREP@"
+EGREP="@EGREP@"
+GETTEXT="@GETTEXT@"
+GNUPLOT="@GNUPLOT@"
+GNUTAR="@GNUTAR@"
+STAR="@STAR@"
+SAMBA_CLIENT="@SAMBA_CLIENT@"
+GZIP="@GZIP@"
+SORT="@SORT@"
+MAILER="@MAILER@"
+PERL="@PERL@"
+AWK="@AWK@"
+
+####
+# Set up PATH for finding amanda executables
+
+PATH="@sbindir@:@amlibexecdir@:$PATH"
+
+####
+# Gettext
+
+# use as follows:
+#   echo `_ "%s: '%s' is not executable" "$myname" "$binpath"`
+# NOTE: use a text editor with shell syntax hilighting to avoid
+# quoting errors!
+
+if test -n "$GETTEXT"; then
+    _() {
+           fmt=`$GETTEXT -d amanda "$1"`
+           shift
+           printf "$fmt" $*
+    }
+else
+    _() {
+       printf "$@"
+    }
+fi