-
-
Save simonecid/7c90f1e9146e948901991732830aabc0 to your computer and use it in GitHub Desktop.
Script that moves incorrect Killing Floor 1 mutators to the correct folder on Linux (fix perk progress reset issue)
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 | |
# Folder where the incorrect downloaded mutators are | |
CACHE_FOLDER=~/.killingfloor/Cache | |
# Folder where they should be after renamed | |
STEAM_SYSTEM_FOLDER=~/.local/share/Steam/steamapps/common/KillingFloor/System/ | |
pushd $CACHE_FOLDER | |
while read p; do | |
# For each non-empty entry of cache.ini | |
if [ -n "$p" ] | |
then | |
IFS='=' read -r -a array <<< "$p" | |
# echo "${array[0]}.uxx" | |
# echo "${array[1]}" | |
# Ignoring [Cache] line | |
if [ "${array[0]}" != "[Cache]" ] | |
then | |
# Move the file to the steam folder with the correct name | |
# printing the command that it is being run | |
set -o xtrace | |
mv $CACHE_FOLDER/"${array[0]}.uxx" $STEAM_SYSTEM_FOLDER/${array[1]} | |
set +o xtrace | |
fi | |
fi | |
done < cache.ini | |
# Erase the previous values from the cache.ini file | |
echo "[Cache]" > cache.ini | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I updated the original script to copy in a different location (it has changed over time, apparently, or it is different on my system, Ubuntu 16.04), to output the mv command for debug, and to ignore the
[Cache]
line