#!/bin/bash # LGSM fn_content_gmod function # Author: Daniel Gibbs # E-Mail: me@danielgibbs.co.uk # Version: 091215 contentdir="${filesdir}/content" fn_gmod_content_usage(){ echo "Usage: $0 [option]" echo "${gamename} - Linux Game Server Manager - Version ${version}" echo "http://gameservermanagers.com/${selfname}" echo -e "" echo -e "\e[93mCommands\e[0m" { echo -e "\e[34minstall-content-all\t\e[0mStart the server." echo -e "\e[34minstall-content-css\t\e[0mStart the server." echo -e "\e[34minstall-content-tf2\t\e[0mStart the server." } | column -s $'\t' -t } fn_content_mode(){ if [ "${gmod-content-mode}" == "all" ]; then : elif [ "${gmod-content-mode}" == "css" ]; then # Counter Strike: Source appid=232330 filesdir="${contentdir}/css" elif [ "${gmod-content-mode}" == "tf2" ]; then # Team Fortress 2 appid=232250 filesdir="${contentdir}/tf2" elif [ "${gmod-content-mode}" == "3" ]; then # Half Life 2 appid=220 filesdir="${contentdir}/hl2" fn_update_check elif [ "${gmod-content-mode}" == "3" ]; then # Half LIfe 2: Episode 1 appid=380 filesdir="${contentdir}/hl2ep1" fn_update_check elif [ "${gmod-content-mode}" == "4" ]; then # Half LIfe 2: Episode 2 appid=420 filesdir="${contentdir}/hl2ep2" fn_update_check elif [ "${gmod-content-mode}" == "5" ]; then # Portal appid=420 filesdir="${contentdir}/portal" fn_update_check fi } fn_install-content(){ fn_install_serverfiles fn_install_complete } fn_content_update(){ for d in ${contentdir} ; do if [ "${d}" == "${contentdir}/css"]; then gmod-content-mode="css" elif [ "${d}" == "${contentdir}/tf2"]; then gmod-content-mode="tf2" fi fn_install-content done }