diff --git a/bin/sentieon b/bin/sentieon
index 52f51aaefd..e27fea8c2b 100755
--- a/bin/sentieon.orig
+++ b/bin/sentieon
@@ -1,13 +1,17 @@
 #!/bin/sh
 # Copyright (c) 2014-2020 Sentieon Inc. All rights reserved
-case "$0" in
-/*)     bin_dir=$(dirname "$0");;
-*)      bin_dir=$(dirname "$(pwd)/$0");;
-esac
-case "$bin_dir" in
-*/.)    install_dir="$bin_dir.";;
-*)      install_dir=$(dirname "$bin_dir");;
-esac
+
+# Find original directory of script, resovling symlinks. Modified from:
+# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128
+SOURCE="$0"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+    DIR="$( cd -P -- "$( dirname -- "$SOURCE" )" && pwd )"
+    SOURCE="$(readlink -- "$SOURCE")"
+    [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
+done
+bin_dir="$( cd -P -- "$( dirname -- "$SOURCE" )" && pwd )"
+install_dir=$(dirname -- "$bin_dir")
+
 export SENTIEON_INSTALL_DIR="$install_dir"

 # load common function definitions
