Просмотр исходного кода

Merge branch 'hotfix/readme' into develop

Daniel Gibbs 8 лет назад
Родитель
Сommit
6541027ff9

Разница между файлами не показана из-за своего большого размера
+ 3 - 2
README.md


+ 0 - 4
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"
 

+ 59 - 2
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

+ 8 - 0
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

+ 1 - 1
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"

+ 7 - 0
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"

+ 7 - 3
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[@]}" )

Некоторые файлы не были показаны из-за большого количества измененных файлов