|
|
@ -2,24 +2,41 @@ |
|
|
|
# LGSM fn_steaminstall function |
|
|
|
# Author: Daniel Gibbs |
|
|
|
# Website: http://danielgibbs.co.uk |
|
|
|
# Version: 011214 |
|
|
|
# Version: 241214 |
|
|
|
|
|
|
|
fn_steaminstallcommand(){ |
|
|
|
echo "0x402" > .fn_steaminstall.tmp |
|
|
|
while [ "$(grep -c 0x402 .fn_steaminstall.tmp)" -ge "1" ]; do |
|
|
|
counter=$((counter+1)) |
|
|
|
if [ "${counter}" -le "10" ]; then |
|
|
|
if [ "${counter}" -ge "2" ]; then |
|
|
|
echo -e "\e[0;31mWarning!\e[0;39m SteamCMD did not complete the download, retrying: Attempt ${counter}" |
|
|
|
fi |
|
|
|
./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_steaminstall.tmp |
|
|
|
elif [ "${counter}" -ge "11" ]; then |
|
|
|
echo -e "\e[0;31mFailure!\e[0;39m SteamCMD did not complete the download, too many retrys" |
|
|
|
break |
|
|
|
fi |
|
|
|
done |
|
|
|
rm -f .fn_steaminstall.tmp |
|
|
|
} |
|
|
|
|
|
|
|
echo "" |
|
|
|
echo "Installing ${gamename} Server" |
|
|
|
echo "=================================" |
|
|
|
sleep 1 |
|
|
|
mkdir -pv "${filesdir}" |
|
|
|
cd "${rootdir}/steamcmd" |
|
|
|
STEAMEXE=steamcmd ./steamcmd.sh +login ${steamuser} "${steampass}" +force_install_dir "${filesdir}" +app_update ${appid} +quit |
|
|
|
if [ -z ${autoinstall} ]; then |
|
|
|
fn_steaminstallcommand |
|
|
|
if [ -z "${autoinstall}" ]; then |
|
|
|
echo "" |
|
|
|
echo "=================================" |
|
|
|
while true; do |
|
|
|
read -p "Was the install successful? [y/N]" yn |
|
|
|
read -p "Was the install successful? [y/N]" yn |
|
|
|
case $yn in |
|
|
|
[Yy]* ) break;; |
|
|
|
[Nn]* ) fn_retryinstall;; |
|
|
|
* ) echo "Please answer yes or no.";; |
|
|
|
[Yy]* ) break;; |
|
|
|
[Nn]* ) fn_retryinstall;; |
|
|
|
* ) echo "Please answer yes or no.";; |
|
|
|
esac |
|
|
|
done |
|
|
|
fi |
|
|
|
echo "" |
|
|
|
fi |