Skip to content

Instantly share code, notes, and snippets.

@janhaag
Created May 1, 2013 18:20
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save janhaag/5497144 to your computer and use it in GitHub Desktop.
Save janhaag/5497144 to your computer and use it in GitHub Desktop.
Fixed AYIM startup script for linux steam
#!/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