diff --git a/README.md b/README.md index 88dbbe801..12111a15d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ -<a href="https://gameservermanagers.com"><img src="https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/images/logo/lgsm-light-full.png" alt="linux Game Server Managers" width="600" /></a> +<a href="https://linuxgsm.com"><img src="https://raw.githubusercontent.com/wiki/GameServerManagers/LinuxGSM/images/brand/colour/LinuxGSM_colour_logo_wordmark_512.png" alt="linux Game Server Managers" width="600" /></a> [](https://linuxgsm.com) [](https://travis-ci.org/GameServerManagers/LinuxGSM) [](http://waffle.io/GameServerManagers/LinuxGSM) -[](https://gameservermanagers.com/discord) +[](https://linuxgsm.com/discord) +[](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) +[](https://www.gnu.org/software/bash/) -<a href="https://gameservermanagers.com">LinuxGSM</a> is the command line tool for quick, simple deployment and management of dedicated game servers. +<a href="https://linuxgsm.com">LinuxGSM</a> is the command line tool for quick, simple deployment and management of dedicated game servers. <h2>Hassle-Free Dedicated Servers</h2> Game servers traditionally are not easy to manage yourself. Admins often have to spend hours just messing around trying to get their server working. LinuxGSM is designed to be a simple as possible allowing admins to spend less time on management and more time gaming. @@ -40,11 +42,11 @@ All FAQ can be found here. <h2>Donate</h2> If you want to donate to the project you can via PayPal. I have had a may kind people show their support by sending me a donation. Any donations you send help cover my server costs and buy me a drink. Cheers! <ul> -<li><a href="https://gameservermanagers.com/#donate">Donate</a></li> +<li><a href="https://linuxgsm.com/donate">Donate</a></li> </ul> <h2>Useful Links</h2> <ul> - <li><a href="https://gameservermanagers.com">Homepage</a></li> + <li><a href="https://linuxgsm.com">Homepage</a></li> <li><a href="https://github.com/GameServerManagers/LinuxGSM/wiki">Wiki</a></li> <li><a href="https://github.com/GameServerManagers/LinuxGSM">GitHub Code</a></li> <li><a href="https://github.com/GameServerManagers/LinuxGSM/issues">GitHub Issues</a></li> @@ -54,8 +56,8 @@ If you want to donate to the project you can via PayPal. I have had a may kind p <h2>Social</h2> <ul> <li><a href="http://steamcommunity.com/groups/linuxgsm">Steam Group</a></li> - <li><a href="https://discord.gg/0i9cmXVacvXicNl7">Discord</a></li> - <li><a href="https://twitter.com/dangibbsuk">Twitter</a></li> + <li><a href="https://linuxgsm.com/discord">Discord</a></li> + <li><a href="https://twitter.com/linuxgsm">Twitter</a></li> <li><a href="https://www.facebook.com/linuxgsm">Facebook</a></li> <li><a href="https://plus.google.com/+Gameservermanagers1">Google+</a></li> <ul> \ No newline at end of file diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index 93b36fb78..ca26f1c7e 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -8,10 +8,6 @@ #### Server Settings #### -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass='password' - ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters ip="0.0.0.0" diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index 4225a2c5e..80e81a191 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -112,8 +112,16 @@ fn_backup_compression(){ sleep 2 fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..." fn_script_log_info "backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" - excludedir=$(realpath --relative-to="${rootdir}" "${backupdir}") - tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" ./* + excludedir=$(fn_backup_relpath) + + # CHECK THAT excludedir is a valid path. + if [ ! -d "${excludedir}" ] ; then + fn_print_info_nl "Problem identifying the previous backup directory for exclusion." + fn_script_log_error "Problem identifying the previous backup directory for exclusion" + core_exit.sh + fi + + tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${tmpdir}/.backup.lock" ./* local exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol @@ -180,6 +188,55 @@ fn_backup_prune(){ fi } +fn_backup_relpath() { + # Written by CedarLUG as a "realpath --relative-to" alternative in bash + + # Populate an array of tokens initialized from the rootdir components: + declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) + + if [ ${#rdirtoks[@]} -eq 0 ]; then + fn_print_info_nl "Problem assessing rootdir during relative path assessment" + fn_script_log_error "Problem assessing rootdir during relative path assessment: ${rootdir}" + core_exit.sh + fi + + # Populate an array of tokens initialized from the backupdir components: + declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) + if [ ${#bdirtoks[@]} -eq 0 ]; then + fn_print_info_nl "Problem assessing backupdir during relative path assessment" + fn_script_log_error "Problem assessing backupdir during relative path assessment: ${rootdir}" + core_exit.sh + fi + + # Compare the leading entries of each array. These common elements will be clipped off + # for the relative path output. + for ((base=0; base<${#rdirtoks[@]}; base++)) + do + [[ "${rdirtoks[$base]}" != "${bdirtoks[$base]}" ]] && break + done + + # Next, climb out of the remaining rootdir location with updir references... + for ((x=base;x<${#rdirtoks[@]};x++)) + do + echo -n "../" + done + + # Climb down the remaining components of the backupdir location. + for ((x=base;x<$(( ${#bdirtoks[@]} - 1 ));x++)) + do + echo -n "${bdirtoks[$x]}/" + done + + # In the event there were no directories left in the backupdir above to + # traverse down, just add a newline. Otherwise at this point, there is + # one remaining directory component in the backupdir to navigate. + if (( "$base" < "${#bdirtoks[@]}" )) ; then + echo "${bdirtoks[ $(( ${#bdirtoks[@]} - 1)) ]}" + else + echo + fi +} + # Restart the server if it was stopped for the backup fn_backup_start_server(){ if [ "${serverstopped}" == "yes" ]; then diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 96aa7b8e4..5dcd36ff0 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -38,6 +38,14 @@ fn_start_teamspeak3(){ fi # Create lockfile date > "${rootdir}/${lockselfname}" + # Accept license + if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then + fn_script_log "Accepting ts3server license: ${executabledir}/LICENSE" + fn_print_info_nl "Accepting TeamSpeak license:" + fn_print_info_nl " * ${executabledir}/LICENSE" + sleep 3 + touch "${executabledir}/.ts3server_license_accepted" + fi cd "${executabledir}" if [ "${ts3serverpass}" == "1" ]; then ./ts3server_startscript.sh start serveradmin_password="${newpassword}" inifile="${servercfgfullpath}" > /dev/null 2>&1 diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index 13f7fbdb0..ea41a65f9 100644 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -8,4 +8,4 @@ local commandname="FIX" local commandaction="Fix" # Fixes: [Raknet] Server Shutting Down (Shutting Down) -export LD_LIBRARY_PATH="${systemdir}/RustDedicated_Data/Plugins/x86_64" +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${systemdir}/RustDedicated_Data/Plugins/x86_64" diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index c2bda5850..66edb34e5 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -55,6 +55,13 @@ else fn_print_warning_nl "./${selfname} auto-install is uses sqlite. For MariaDB/MySQL use ./${selfname} install" fi +## License +fn_script_log "Accepting ts3server license: ${executabledir}/LICENSE" +fn_print_info_nl "Accepting TeamSpeak license:" +fn_print_info_nl " * ${executabledir}/LICENSE" +sleep 3 +touch "${executabledir}/.ts3server_license_accepted" + ## Get privilege key echo "" echo "Getting privilege key" diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index 47131af69..5852117eb 100644 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -26,6 +26,10 @@ sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodmversion}/source sourcemodlatestfile="$(wget "${sourcemodscrapeurl}" -q -O -)" sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodmversion}" sourcemodurl="${sourcemoddownloadurl}" +# Oxide +oxiderustlatestlink="$(curl -s https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | grep browser_download_url | cut -d '"' -f 4)" +oxidehurtworldlatestlink="$(curl -s https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep "Oxide.Hurtworld.zip")" +oxidesdtdlatestlink="$(curl -s https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | grep browser_download_url | cut -d '"' -f 4)" # Define mods information (required) @@ -66,9 +70,9 @@ mod_info_advdupe2=( MOD "advdupe2" "Advanced Duplicator 2" "https://github.com/w mod_info_darkrp=( MOD "darkrp" "DarkRP" "https://github.com/FPtje/DarkRP/archive/master.zip" "darkrp-master.zip" "0" "LowercaseOn" "${systemdir}/gamemodes" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Most popular gamemode" ) mod_info_darkrpmodification=( MOD "darkrpmodification" "DarkRP Modification" "https://github.com/FPtje/darkrpmodification/archive/master.zip" "darkrpmodification-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "NOUPDATE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Customize DarkRP settings" ) # Oxidemod -mod_info_rustoxide=( MOD "rustoxide" "Oxide for Rust" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-Rust.zip" "Oxide-Rust.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-rust.1659/" "Allows for the use of plugins" ) -mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-Hurtworld.zip" "Oxide-Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-hurtworld.1332/" "Allows for the use of plugins" ) -mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-SevenDaysToDie.zip" "Oxide-SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-7-days-to-die.813/" "Allows for the use of plugins" ) +mod_info_rustoxide=( MOD "rustoxide" "Oxide for Rust" "${oxiderustlatestlink}" "Oxide.Rust.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-rust.1659/" "Allows for the use of plugins" ) +mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestlink}" "Oxide.Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-hurtworld.1332/" "Allows for the use of plugins" ) +mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-7-days-to-die.813/" "Allows for the use of plugins" ) # REQUIRED: Set all mods info into the global array mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" )