Fix file not found bug when running outside of contrib folder
@@ -36,13 +36,15 @@ END
exit
}
-CONF_TEMPLATE="karaf-service-template.conf"
-SYSTEMD_TEMPLATE="karaf-service-template.systemd"
-SYSTEMD_TEMPLATE_INSTANCES="karaf-service-template.systemd-instances"
-INIT_TEMPLATE="karaf-service-template.init"
-INIT_REDHAT_TEMPLATE="karaf-service-template.init-redhat"
-INIT_DEBIAN_TEMPLATE="karaf-service-template.init-debian"
-SOLARIS_SMF_TEMPLATE="karaf-service-template.solaris-smf"
+CONTRIB_FOLDER=`dirname "$0"`
+CONF_TEMPLATE="${CONTRIB_FOLDER}/karaf-service-template.conf"
+SYSTEMD_TEMPLATE="${CONTRIB_FOLDER}/karaf-service-template.systemd"
+SYSTEMD_TEMPLATE_INSTANCES="${CONTRIB_FOLDER}/karaf-service-template.systemd-instances"
+INIT_TEMPLATE="${CONTRIB_FOLDER}/karaf-service-template.init"
+INIT_REDHAT_TEMPLATE="${CONTRIB_FOLDER}/karaf-service-template.init-redhat"
+INIT_DEBIAN_TEMPLATE="${CONTRIB_FOLDER}/karaf-service-template.init-debian"
+SOLARIS_SMF_TEMPLATE="${CONTRIB_FOLDER}/karaf-service-template.solaris-smf"
+
################################################################################
#
