Created
February 22, 2016 09:48
-
-
Save benleov/dc44ca9505a807e7dcc9 to your computer and use it in GitHub Desktop.
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 | |
# Replace symlinks for Steam to local version | |
# | |
LINKPATH="${HOME}/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu" | |
LIBPATH="/usr/lib/i386-linux-gnu" | |
for LIB in libva{,-{x11,glx}}.so.1; do | |
if [ -e "${LIBPATH}/${LIB}" ]; then | |
if [ -e "${LINKPATH}/${LIB}" ]; then | |
if [ -L "${LINKPATH}/${LIB}" ]; then | |
echo "NOTICE: ${LINKPATH}/${LIB} is a symlink. Updating link ..." | |
rm "${LINKPATH}/${LIB}" | |
# Link will be created later down the script | |
else | |
echo "ERROR: ${LINKPATH}/${LIBLINK} exists but is not a symlink! Aborting ..." | |
exit 2 | |
fi | |
else | |
echo "WARN: ${LINKPATH}/${LIB} does not exist, creating symlink ..." | |
fi | |
ln -s "${LIBPATH}/${LIB}" "${LINKPATH}/${LIB}" | |
else | |
echo "File ${LIBPATH}/${LIB} does not exist, aborting!" | |
exit 1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment