Created
May 1, 2013 18:20
Fixed AYIM startup script for linux steam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### And Yet It Moves' Simple Startscript | |
### Run, jump and turn the world upside-down with And Yet It Moves! | |
### Enjoy! | |
### webs | |
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" | |
libdir="lib" | |
bin=lib/AndYetItMoves | |
if [ ! -w "${rootdir}/${libdir}" ]; then | |
echo "This script must be run as a user with write priviledges to game directory" | |
echo "${rootdir}/${libdir}" | |
exit 1 | |
fi | |
if [ -d $HOME/Broken\ Rules ] && [ -d $HOME/Broken\ Rules/And\ Yet\ It\ Moves ]; then | |
if ! [ -e $HOME/.Broken\ Rules ]; then | |
mv $HOME/Broken\ Rules $HOME/.Broken\ Rules | |
mv $HOME/.Broken\ Rules/And\ Yet\ It\ Moves/common/commonConfig.xml $HOME/.Broken\ Rules/And\ Yet\ It\ Moves/common/commonConfig.xml.old | |
cat $HOME/.Broken\ Rules/And\ Yet\ It\ Moves/common/commonConfig.xml.old | sed -e 's/<Company>Broken Rules/<Company>\.Broken Rules/' > $HOME/.Broken\ Rules/And\ Yet\ It\ Moves/common/commonConfig.xml | |
rm $HOME/.Broken\ Rules/And\ Yet\ It\ Moves/common/commonConfig.xml.old | |
fi | |
fi | |
if [ -e "${rootdir}/libsteam_api.so" ] && [ ! -e "${rootdir}/${libdir}/libsteam_api.so" ]; then | |
ln -s "${rootdir}/libsteam_api.so" "${rootdir}/${libdir}/libsteam_api.so" | |
fi | |
missing=$(ldd "${rootdir}/${bin}" | awk '{ if ( $3 == "not") print $1 }') | |
missing_lib="false" | |
for lib in $missing; do | |
if [ ! -e "${rootdir}/${libdir}/${lib}" ]; then | |
echo "Library Missing: $lib" | |
missing_lib="true" | |
fi | |
done | |
[ $missing_lib == "true" ] && exit 1 | |
export LD_LIBRARY_PATH="${rootdir}/${libdir}":$LD_LIBRARY_PATH | |
exec "${rootdir}/${bin}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment