diff options
Diffstat (limited to 'rel/files/couchdb.in')
-rwxr-xr-x | rel/files/couchdb.in | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/rel/files/couchdb.in b/rel/files/couchdb.in index b3c7e98e2..f64c0f860 100755 --- a/rel/files/couchdb.in +++ b/rel/files/couchdb.in @@ -12,7 +12,17 @@ # License for the specific language governing permissions and limitations under # the License. -COUCHDB_BIN_DIR=$(cd "${0%/*}" && pwd) +canonical_readlink () + { + cd $(dirname $1); + FILE=$(basename $1); + if [ -h "$FILE" ]; then + canonical_readlink $(readlink $FILE); + else + echo "$(pwd -P)"; + fi +} +COUCHDB_BIN_DIR=$(canonical_readlink $0) ERTS_BIN_DIR=$COUCHDB_BIN_DIR/../ cd "$COUCHDB_BIN_DIR/../" |