X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=karaf%2Fopendaylight-karaf-resources%2Fsrc%2Fmain%2Fresources%2Fbin%2Finstance;h=d7a344c483045c0e8f898a672d1e350174de0a12;hp=32a8854be5d912f2860853dd2b63f106869b70ce;hb=0eda999492644870f55582837e469ee3b3729e5d;hpb=d732c8b8e2fff180545918192dabd376748a9130 diff --git a/karaf/opendaylight-karaf-resources/src/main/resources/bin/instance b/karaf/opendaylight-karaf-resources/src/main/resources/bin/instance old mode 100644 new mode 100755 index 32a8854be5..d7a344c483 --- a/karaf/opendaylight-karaf-resources/src/main/resources/bin/instance +++ b/karaf/opendaylight-karaf-resources/src/main/resources/bin/instance @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -16,8 +16,12 @@ # limitations under the License. # -DIRNAME=`dirname "$0"` -PROGNAME=`basename "$0"` +REALNAME=`readlink -e "$0"` +if [ $? != 0 ]; then + REALNAME=$0 +fi +DIRNAME=`dirname "$REALNAME"` +PROGNAME=`basename "$REALNAME"` # # Sourcing environment settings for karaf similar to tomcats setenv @@ -162,7 +166,7 @@ setupNativePath() { } pathCanonical() { - local dst="${1}" + dst="${1}" while [ -h "${dst}" ] ; do ls=`ls -ld "${dst}"` link=`expr "$ls" : '.*-> \(.*\)$'` @@ -172,8 +176,8 @@ pathCanonical() { dst="`dirname "${dst}"`/$link" fi done - local bas=`basename "${dst}"` - local dir=`dirname "${dst}"` + bas=`basename "${dst}"` + dir=`dirname "${dst}"` if [ "$bas" != "$dir" ]; then dst="`pathCanonical "$dir"`/$bas" fi