- #!/bin/sh
- TARGET_FILE=$0
- cd `dirname $TARGET_FILE`
- TARGET_FILE=`basename $TARGET_FILE`
- # Iterate down a (possible) chain of symlinks
- while [ -L "$TARGET_FILE" ]
- do
- TARGET_FILE=`readlink $TARGET_FILE`
- cd `dirname $TARGET_FILE`
- TARGET_FILE=`basename $TARGET_FILE`
- done
- # Compute the canonicalized name by finding the physical path
- # for the directory we're in and appending the target file.
- PHYS_DIR=`pwd -P`
- RESULT=$PHYS_DIR/$TARGET_FILE
- echo $RESULT
- DIR=$(dirname $RESULT)
- BIN=$(basename $RESULT)
- cd "$DIR" || exit $?
- # If name does not match a binary or is this same script, find the right one
- if [ ! -f "$BIN" ] || [ "$BIN" = "$(basename $RESULT)" ]
- then
- BIN=
- for bin in cataclysm-tiles cataclysm
- do
- [ -f "$bin" ] && BIN="$bin" && break
- done
- fi
- if [ "$BIN" ]
- then
- exec "./$BIN"
- else
- echo "Couldn't find cataclysm game binary in $DIR/"
- exit 1
- fi
SHARE
TWEET
cataclysm starter
a guest
Mar 5th, 2014
301
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

