diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-04-23 08:34:53 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-04-23 11:34:25 +0200 |
commit | ab92d94caee54149e2594b732d93960e894dfdaf (patch) | |
tree | 0dd1a2fd282e2b99d912e688a786e83d19c005d1 | |
parent | 5690826e2c22938264eae0db676826d243e71945 (diff) | |
download | alpine-conf-ab92d94caee54149e2594b732d93960e894dfdaf.zip |
libalpine: initialize $ROOT
-rw-r--r-- | libalpine.sh.in | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libalpine.sh.in b/libalpine.sh.in index 7aec815..6c6cc4e 100644 --- a/libalpine.sh.in +++ b/libalpine.sh.in @@ -4,6 +4,10 @@ PREFIX=@PREFIX@ PROGRAM=`basename $0` +: ${ROOT:=/} +[ "${ROOT}" = "${ROOT%/}" ] && ROOT="${ROOT}/" +[ "${ROOT}" = "${ROOT#/}" ] && ROOT="${PWD}/${ROOT}" + echon () { if [ X"$ECHON" = X ]; then # Determine how to "echo" without newline: "echo -n" |