Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Bug 6027 - Can't start karaf using symbolic link
[controller.git]
/
karaf
/
opendaylight-karaf-resources
/
src
/
main
/
resources
/
bin
/
instance
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
(file)
new mode 100755
(executable)
index
32a8854
..
d7a344c
--- 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/
ba
sh
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
#
# 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.
#
# 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
#
# Sourcing environment settings for karaf similar to tomcats setenv
@@
-162,7
+166,7
@@
setupNativePath() {
}
pathCanonical() {
}
pathCanonical() {
-
local
dst="${1}"
+ dst="${1}"
while [ -h "${dst}" ] ; do
ls=`ls -ld "${dst}"`
link=`expr "$ls" : '.*-> \(.*\)$'`
while [ -h "${dst}" ] ; do
ls=`ls -ld "${dst}"`
link=`expr "$ls" : '.*-> \(.*\)$'`
@@
-172,8
+176,8
@@
pathCanonical() {
dst="`dirname "${dst}"`/$link"
fi
done
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
if [ "$bas" != "$dir" ]; then
dst="`pathCanonical "$dir"`/$bas"
fi