#!/bin/bash
# LGSM fn_check_steamcmd function
# Author: Daniel Gibbs
# Website: http://gameservermanagers.com
# Version: 210115

# Description: Downloads SteamCMD on install and checks if missing before running functions that require SteamCMD

echo ""
echo "Installing SteamCMD"
echo "================================="
cd "${rootdir}"
mkdir -pv "steamcmd"
sleep 1
cd "steamcmd"
if [ ! -f steamcmd.sh ]; then
		echo -e "downloading steamcmd_linux.tar.gz...\c"
		wget -N /dev/null http://media.steampowered.com/client/steamcmd_linux.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq
		tar --verbose -zxf steamcmd_linux.tar.gz
		rm -v steamcmd_linux.tar.gz
		chmod +x steamcmd.sh
		sleep 1
else
		echo "Steam already installed!"
fi
sleep 1
