summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-05-21 13:08:12 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-05-21 13:08:12 +0000
commitb92c930df4ed2f5dc749eba2f098294f4a934d30 (patch)
treea778b228c141617affa49ba9b33716527570baad
parent9cca548848c41d58024b02a4925b775d68a161dd (diff)
downloadalpine-conf-b92c930df4ed2f5dc749eba2f098294f4a934d30.zip
libalpine: added die()
-rwxr-xr-xlibalpine.sh.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/libalpine.sh.in b/libalpine.sh.in
index ce31dad..b47fa71 100755
--- a/libalpine.sh.in
+++ b/libalpine.sh.in
@@ -4,7 +4,6 @@ PREFIX=@PREFIX@
PROGRAM=`basename $0`
-
echon () {
if [ X"$ECHON" = X ]; then
# Determine how to "echo" without newline: "echo -n"
@@ -36,6 +35,12 @@ eecho() {
echo "$@" >&2
}
+# echo to stderr and exit with error
+die() {
+ eecho "$@"
+ exit 1
+}
+
init_tmpdir() {
local omask=`umask`
local __tmpd="/tmp/$PROGRAM-${$}-`date +%s`-$RANDOM"