diff --git a/functions/fn_header b/functions/fn_header new file mode 100644 index 000000000..2ef6c9ec1 --- /dev/null +++ b/functions/fn_header @@ -0,0 +1,14 @@ +#!/bin/bash +# LGSM fn_header function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 011214 + +clear +echo "=================================" +echo "${gamename}" +echo "Linux Game Server Manager" +echo "by Daniel Gibbs" +echo "http://danielgibbs.co.uk" +echo "=================================" +echo "" \ No newline at end of file diff --git a/functions/fn_serverdirectory b/functions/fn_serverdirectory new file mode 100644 index 000000000..c015789d5 --- /dev/null +++ b/functions/fn_serverdirectory @@ -0,0 +1,22 @@ +#!/bin/bash +# LGSM fn_serverdirectory function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 011214 + +echo "Server Directory" +echo "=================================" +echo "" +pwd +echo "" +if [ -d "${filesdir}" ]; then + echo -e "\e[0;31mWARNING!\e[0;39m A server is already installed here" +fi +while true; do + read -p "Continue [y/N]" yn + case $yn in + [Yy]* ) break;; + [Nn]* ) echo Exiting; return 1;; + * ) echo "Please answer yes or no.";; + esac +done \ No newline at end of file diff --git a/functions/fn_steamdl b/functions/fn_steamdl new file mode 100644 index 000000000..c2f3237e7 --- /dev/null +++ b/functions/fn_steamdl @@ -0,0 +1,23 @@ +#!/bin/bash +# LGSM fn_steamdl function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 231114 + +echo "Installing SteamCMD" +echo "=================================" +cd "${rootdir}" +mkdir -pv "steamcmd" +sleep 1 +cd "steamcmd" +if [ ! -f steamcmd.sh ]; then + wget -nv -N http://media.steampowered.com/client/steamcmd_linux.tar.gz + 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 +echo "" \ No newline at end of file diff --git a/functions/fn_steaminstall b/functions/fn_steaminstall new file mode 100644 index 000000000..a6d0f5c07 --- /dev/null +++ b/functions/fn_steaminstall @@ -0,0 +1,25 @@ +#!/bin/bash +# LGSM fn_steaminstall function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 011214 + +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 + echo "" + echo "=================================" + while true; do + read -p "Was the install successful? [y/N]" yn + case $yn in + [Yy]* ) break;; + [Nn]* ) fn_retryinstall;; + * ) echo "Please answer yes or no.";; + esac + done +fi +echo "" \ No newline at end of file