1#!/bin/sh
2#
3# This work is dual-licensed under the Apache License 2.0
4# and European Union Public License. See LICENSE file for details.
5#
6# Parts of this file Copyright (c) 2017 Evolveum and contributors
7#
8
9# resolve links - $0 may be a softlink
10PRG="$0"
11
12while [ -h "$PRG" ] ; do
13  ls=`ls -ld "$PRG"`
14  link=`expr "$ls" : '.*-> \(.*\)$'`
15  if expr "$link" : '/.*' > /dev/null; then
16    PRG="$link"
17  else
18    PRG=`dirname "$PRG"`/"$link"
19  fi
20done
21
22PRGDIR=`dirname "$PRG"`
23EXECUTABLE=midpoint.sh
24
25  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
26    echo "Cannot find $PRGDIR/$EXECUTABLE"
27    echo "The file is absent or does not have execute permission"
28    echo "This file is needed to run this program"
29    exit 1
30  fi
31
32
33exec "$PRGDIR"/"$EXECUTABLE" start "$@"
34
35