diff --git a/PiratesVikingandKnightsII/cfg/lgsm-default.cfg b/PiratesVikingandKnightsII/cfg/lgsm-default.cfg new file mode 100644 index 000000000..8469f1014 --- /dev/null +++ b/PiratesVikingandKnightsII/cfg/lgsm-default.cfg @@ -0,0 +1,119 @@ +// **************************************************************************** +// * +// Pirates, Vikings, and Knights II * +// Version 150815 * +// * +// **************************************************************************** + +// ............................. Basic Settings ............................. // + +// Hostname for server. +hostname "" + +// RCON - remote console password. +rcon_password "" + +// Server password - for private servers. +sv_password "" + +// Contact email for server sysop. +sv_contact "email@example.com" + +// LAN Mode - If set the server will not show on the internet. +// Default: sv_lan 0 +sv_lan 0 + +// ............................... Map Cycles ............................... // +// You can create your own custom mapcycle. +mapcyclefile "mapcycle.txt" + +// ....................... Time Limits/Round Settings ....................... // + +// Time spend on a single map (in minutes) before switching to a new one automatically. +// Default: mp_timelimit 0 +mp_timelimit 20 + +// Wait for the end of round before changing map. +// Default: mp_timelimit_waitroundend 0 +mp_timelimit_waitroundend 1 + +// Round duration in minutes. +// Default: mp_roundtime 3 +mp_roundtime 3 + +// Round limit in number of rounds. +// Default: mp_roundlimit 0 + +// Win limit in number of rounds. +// Default: mp_winlimit 0 +mp_winlimit 0 + +// ........................ Server Specific Commands ........................ // + +// Server tags - Tags show up on the in-game server browser. This helps +// users filter servers. +// vanilla - he server runs the default settings. +// custom - the server runs custom gameplay settings or mods. +// example: sv_tags "custom, fastdl" +sv_tags "" + +// Friendly fire - Allows team members to injure other members of their team. +// Default: mp_friendlyfire 0 +mp_friendlyfire 0 + +// ............................. Communication ............................. // + +// Enable communication over voice via microphone. +// Default: sv_voiceenable 1 +sv_voiceenable 1 + +// Players can hear all other players, no team restrictions. +// Default: sv_alltalk 0 +sv_alltalk 0 + +// ............................. Fast Download .............................. // +// info: Allows custom maps to be downloaded to the client. + +// Allows clients to download custom maps and textures etc. from the server at 20 kbps. +// Default: sv_allowdownload 1 +sv_allowdownload 1 + +// Allows clients to download custom maps, textures etc. from a web server with no transfer limit. +// Example: +// server location: maps/custommap.bsp +// web server location: http://example.com/custom/maps/custommap.bsp +// sv_downloadurl "http://example.com/custom" +// Default: sv_downloadurl "" +sv_downloadurl "" + +// ................................ Ban List ............................... // + +// personal banlist based on user IDs. +exec banned_user.cfg + +// personal banlist based on user IPs. +exec banned_ip.cfg + +writeid +writeip + +// ............................. Server Logging ............................. // + +//Enables logging to file, console, and udp < on | off >. +log on + +// Log server bans in the server logs. +// Default: sv_logbans 1 +sv_logbans 1 + +// Echo log information to the console. +// Default: sv_logecho 1 +sv_logecho 1 + +// Log server information in the log file. +// Default: sv_logfile 1 +sv_logfile 1 + +// Log server information to only one file. +// Default: sv_log_onefile 0 +sv_log_onefile 0 diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver new file mode 100644 index 000000000..baa625b47 --- /dev/null +++ b/PiratesVikingandKnightsII/pvkiiserver @@ -0,0 +1,98 @@ +#!/bin/bash +# No More Room in Hell +# Server Management Script +# Author: Daniel Gibbs +# Website: http://gameservermanagers.com +version="051115" + +#### Variables #### + +# Notification Email +# (on|off) +emailnotification="off" +email="email@example.com" + +# Steam login +steamuser="anonymous" +steampass="" + +# Start Variables +defaultmap="bt_island" +maxplayers="24" +port="27015" +sourcetvport="27020" +clientport="27005" +ip="0.0.0.0" +updateonstart="off" + +# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server +fn_parms(){ +parms="-game pvkii -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### Advanced Variables #### + +# Steam +appid="17575" + +# Server Details +servicename="pvkii-server" +gamename="Pirates, Vikings, and Knights II" +engine="source" + +# Directories +rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +selfname="$(basename $0)" +lockselfname=".${servicename}.lock" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}/pvkii" +executabledir="${filesdir}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/lgsm-default.cfg" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${systemdir}/logs" +scriptlogdir="${rootdir}/log/script" +consolelogdir="${rootdir}/log/console" + +scriptlog="${scriptlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +emaillog="${scriptlogdir}/${servicename}-email.log" + +scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" + +##### Script ##### +# Do not edit + +fn_runfunction(){ +# Functions are downloaded and run with this function +if [ ! -f "${rootdir}/functions/${functionfile}" ]; then + cd "${rootdir}" + if [ ! -d "functions" ]; then + mkdir functions + fi + cd functions + echo -e " loading ${functionfile}...\c" + wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- + chmod +x "${functionfile}" + cd "${rootdir}" +fi +source "${rootdir}/functions/${functionfile}" +} + +fn_functions(){ +# Functions are defined in fn_functions. +functionfile="${FUNCNAME}" +fn_runfunction +} + +fn_functions + +getopt=$1 +fn_getopt diff --git a/functions/fn_check_steamuser b/functions/fn_check_steamuser index 5080c98d8..264d7cb49 100644 --- a/functions/fn_check_steamuser +++ b/functions/fn_check_steamuser @@ -4,18 +4,20 @@ # Website: http://gameservermanagers.com # Version: 040715 -if [ -z "${steamuser}" ]||[ "${steamuser}" == "username" ]; then - fn_printwarnnl "Steam login not set. Using anonymous login." - if [ -d ${scriptlogdir} ]; then - fn_scriptlog "Steam login not set. Using anonymous login." - fi - if [ "${steamuser}" == "username" ]; then - echo " * Change steamuser=\"username\" to a valid steam login." - if [ -d ${scriptlogdir} ]; then - fn_scriptlog "Change steamuser=\"username\" to a valid steam login." - fi - fi - steamuser="anonymous" - steampass="" - sleep 2 +if [ "${steamuser}" == "username" ]; then + fn_printfailnl "Steam login not set. Update steamuser." + echo " * Change steamuser=\"username\" to a valid steam login." + if [ -d ${scriptlogdir} ]; then + fn_scriptlog "edit ${selfname}. change steamuser=\"username\" to a valid steam login." + exit 1 + fi +fi +if [ -z "${steamuser}" ]; then + fn_printwarnnl "Steam login not set. Using anonymous login." + if [ -d ${scriptlogdir} ]; then + fn_scriptlog "Steam login not set. Using anonymous login." + fi + steamuser="anonymous" + steampass="" + sleep 2 fi diff --git a/functions/fn_debug b/functions/fn_debug index d303e6498..ce2f91ce9 100644 --- a/functions/fn_debug +++ b/functions/fn_debug @@ -2,7 +2,7 @@ # LGSM fn_debug function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +# Version: 051115 # Description: Runs the server without tmux. Runs direct from the terminal. @@ -34,7 +34,7 @@ echo -e "Press CTRL+c to drop out of debug mode." fn_printwarningnl "If ${servicename} is already running it will be stopped." echo "" while true; do - read -p "Continue? [y/N]" yn + read -e -i "y" -p "Continue? [Y/n]" yn case $yn in [Yy]* ) break;; [Nn]* ) echo Exiting; return;; diff --git a/functions/fn_details b/functions/fn_details index 845eafca4..c5ced1434 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -372,6 +372,7 @@ fn_details_statusbottom } fn_details_source(){ +pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") fn_check_ip fn_parms fn_details_config diff --git a/functions/fn_getopt b/functions/fn_getopt index e495fc566..20007fcd1 100644 --- a/functions/fn_getopt +++ b/functions/fn_getopt @@ -2,227 +2,397 @@ # LGSM fn_getopt function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +# Version: 011115 # Description: getopt arguments. fn_getopt_generic(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update) + u|update) fn_update_check;; - force-update) + fu|force-update|update-restart) forceupdate=1; fn_update_check;; - update-restart) - forceupdate=1; - fn_update_check;; - update-functions) + uf|update-functions) fn_update_functions;; - validate) + v|validate) fn_validate;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - details) + d|details) fn_details;; - backup) + b|backup) fn_backup;; - console) + c|console) fn_console;; - debug) + d|debug) fn_debug;; - install) + i|install) fn_install;; - auto-install) + ai|auto-install) fn_autoinstall;; - depsdetect) - fn_deps_detect;; + dd|depsdetect) + fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update|force-update|update-functions|validate|monitor|email-test|details|backup|console|debug|install|auto-install}" -esac + 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[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." + echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." + } | column -s $'\t' -t + esac exit } fn_getopt_teamspeak3(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update) + u|update) fn_update_check;; - update-functions) + uf|update-functions) fn_update_functions;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - details) + d|details) fn_details;; - backup) + b|backup) fn_backup;; - install) + i|install) fn_install;; - auto-install) + ai|auto-install) fn_autoinstall;; - depsdetect) - fn_deps_detect;; + dd|depsdetect) + fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update|update-functions|monitor|email-test|details|backup|install|auto-install}" -esac + 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[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate\t\e[0mChecks and applies updates from teamspeak.com." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." + } | column -s $'\t' -t + esac exit } fn_getopt_mumble(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update-functions) + uf|update-functions) fn_update_functions;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - backup) + b|backup) fn_backup;; console) fn_console;; - debug) + d|debug) fn_debug;; - depsdetect) - fn_deps_detect;; + dd|depsdetect) + fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update-functions|monitor|email-test|backup|console|debug}" -esac + 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[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + } | column -s $'\t' -t + esac +exit +} + +fn_getopt_gmodserver(){ +case "$getopt" in + st|start) + fn_start;; + sp|stop) + fn_stop;; + r|restart) + fn_restart;; + u|update) + fn_update_check;; + fu|force-update|update-restart) + forceupdate=1; + fn_update_check;; + uf|update-functions) + fn_update_functions;; + v|validate) + fn_validate;; + m|monitor) + fn_monitor;; + et|email-test) + fn_email_test;; + d|details) + fn_details;; + b|backup) + fn_backup;; + c|console) + fn_console;; + d|debug) + fn_debug;; + i|install) + fn_install;; + ai|auto-install) + fn_autoinstall;; + dd|depsdetect) + fn_deps_detect;; + gc|gmod-content) + fn_content_gmod;; + *) + 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[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." + echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." + echo -e "\e[34mgmod-content\t\e[0mDownload gmod add-on content." + } | column -s $'\t' -t + esac exit } fn_getopt_unreal(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update-functions) + uf|update-functions) fn_update_functions;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - details) + d|details) fn_details;; - backup) + b|backup) fn_backup;; - console) + c|console) fn_console;; - debug) + d|debug) fn_debug;; - install) + i|install) fn_install;; - map-compressor) + mc|map-compressor) fn_compress_ut99maps;; - depsdetect) + dd|depsdetect) fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update-functions|monitor|email-test|details|backup|console|debug|install|map-compressor}" -esac + 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[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." + } | column -s $'\t' -t + esac exit } fn_getopt_unreal2(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update) - fn_update_check;; - force-update) - forceupdate=1; + u|update) fn_update_check;; - update-restart) + fu|force-update|update-restart) forceupdate=1; fn_update_check;; - update-functions) + uf|update-functions) fn_update_functions;; - validate) + v|validate) fn_validate;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - details) + d|details) fn_details;; - backup) + b|backup) fn_backup;; - console) + c|console) fn_console;; - debug) + d|debug) fn_debug;; - install) + i|install) fn_install;; - auto-install) + ai|auto-install) fn_autoinstall;; - map-compressor) + dd|depsdetect) + fn_deps_detect;; + mc|map-compressor) fn_compress_unreal2maps;; - depsdetect) - fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update|update-functions|validate|monitor|email-test|details|backup|console|debug|install|auto-install|map-compressor}" -esac + 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[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." + echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." + echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." + } | column -s $'\t' -t + esac exit } fn_getopt_ut2k4(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update-functions) + uf|update-functions) fn_update_functions;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - details) + d|details) fn_details;; - backup) + b|backup) fn_backup;; - console) + c|console) fn_console;; - debug) + d|debug) fn_debug;; - install) + i|install) fn_install;; - map-compressor) - fn_compress_unreal2maps;; - depsdetect) + mc|map-compressor) + fn_compress_ut99maps;; + dd|depsdetect) fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update-functions|monitor|email-test|details|backup|console|debug|install|map-compressor}" -esac + 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[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." + } | column -s $'\t' -t + esac exit } diff --git a/functions/fn_install_config b/functions/fn_install_config index 1dfa75168..3cc70d389 100644 --- a/functions/fn_install_config +++ b/functions/fn_install_config @@ -2,7 +2,7 @@ # LGSM fn_install_config function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 291015 +# Version: 051115 fn_defaultconfig(){ echo "creating ${servercfg} config file." @@ -281,6 +281,11 @@ elif [ "${gamename}" == "Natural Selection 2" ]; then echo -e "no configs required." sleep 1 echo "" +elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then + echo -e "downloading lgsm-default.cfg...\c" + wget -N /dev/null ${githuburl}/PiratesVikingandKnightsII/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq + sleep 1 + fn_sourceconfig elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then fn_unreal2config elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then diff --git a/functions/fn_install_glibcfix b/functions/fn_install_glibcfix index 18f1b0840..11dc3362d 100644 --- a/functions/fn_install_glibcfix +++ b/functions/fn_install_glibcfix @@ -2,7 +2,7 @@ # LGSM fn_install_glibcfix function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 301015 +# Version: 051115 fn_glibcfixmsg(){ echo "" @@ -40,7 +40,7 @@ if [ -z $(command -v ldd) ]; then sleep 1 echo "" while true; do - read -p "Continue install? [y/N]" yn + read -e -i "y" -p "Continue install? [Y/n]" yn case $yn in [Yy]* ) break;; [Nn]* ) echo Exiting; exit;; diff --git a/functions/fn_install_gsquery b/functions/fn_install_gsquery index ca2647908..896e01eff 100644 --- a/functions/fn_install_gsquery +++ b/functions/fn_install_gsquery @@ -2,7 +2,7 @@ # LGSM fn_install_gsquery function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 070715 +# Version: 051115 fn_dlgsquery(){ cd "${rootdir}" @@ -17,7 +17,7 @@ if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine} echo "============================" if [ -z ${autoinstall} ]; then while true; do - read -p "Do you want to install GameServerQuery? [y/N]" yn + read -e -i "y" -p "Do you want to install GameServerQuery? [Y/n]" yn case $yn in [Yy]* ) fn_dlgsquery;break;; [Nn]* ) echo ""; echo "Not installing GameServerQuery.";break;; diff --git a/functions/fn_install_retry b/functions/fn_install_retry index 0f3117e21..7146327e1 100644 --- a/functions/fn_install_retry +++ b/functions/fn_install_retry @@ -2,10 +2,10 @@ # LGSM fn_install_retry function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +# Version: 051115 while true; do - read -p "Retry install? [y/N]" yn + read -e -i "y" -p "Retry install? [Y/n]" yn case $yn in [Yy]* ) fn_install; exit;; [Nn]* ) echo Exiting; exit;; diff --git a/functions/fn_install_serverfiles b/functions/fn_install_serverfiles index ffeeebdd1..961106370 100644 --- a/functions/fn_install_serverfiles +++ b/functions/fn_install_serverfiles @@ -2,7 +2,7 @@ # LGSM fn_install_serverfiles function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 040715 +# Version: 051115 fn_steaminstallcommand(){ fn_check_steamuser @@ -78,7 +78,7 @@ if [ -z "${autoinstall}" ]; then echo "" echo "=================================" while true; do - read -p "Was the install successful? [y/N]" yn + read -e -i "y" -p "Was the install successful? [Y/n]" yn case $yn in [Yy]* ) break;; [Nn]* ) fn_install_retry;; diff --git a/functions/fn_update_check b/functions/fn_update_check index 443a88f1c..8ccda2105 100644 --- a/functions/fn_update_check +++ b/functions/fn_update_check @@ -2,7 +2,7 @@ # LGSM fn_update_check function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +# Version: 011115 # Description: Checks if a server update is available. @@ -53,7 +53,7 @@ if [ "${appmanifestfilewc}" -ge "2" ]; then fn_update_check fi elif [ "${appmanifestfilewc}" -eq "0" ]; then - if [ "${forceupdate}" -eq "1" ]; then + if [ "${forceupdate}" == "1" ]; then fn_printfail "Still no appmanifest_${appid}.acf found: Unable to update" fn_scriptlog "Warning! Still no appmanifest_${appid}.acf found: Unable to update" exit 1 @@ -135,7 +135,7 @@ else sleep 1 fi -if [ "${currentbuild}" -ne "${availablebuild}" ]; then +if [ "${currentbuild}" != "${availablebuild}" ]; then echo -e "\n" echo -e "Update available:" sleep 1 diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index b279207c6..b6d4dbec3 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -148,6 +148,7 @@ echo "Using: ${gamename}" echo "=================================" echo "" sleep 1 +mkdir ${rootfdir} @@ -440,4 +441,4 @@ sleep 1 fn_printinfo "Tidying up directories." sleep 1 rm -rfv ${serverfiles} -echo "END" \ No newline at end of file +echo "END"