Browse Source

Merge remote-tracking branch 'refs/remotes/origin/master' into development

pull/875/head
Daniel Gibbs 9 years ago
parent
commit
e9440c85d7
  1. 4
      BrainBread2/bb2server
  2. 6
      lgsm/functions/check_deps.sh
  3. 96
      lgsm/functions/command_fastdl.sh
  4. 4
      lgsm/functions/command_stop.sh
  5. 2
      lgsm/functions/fix_ins.sh
  6. 2
      lgsm/functions/update_check.sh

4
BrainBread2/bb2server

@ -9,7 +9,7 @@ if [ -f ".dev-debug" ]; then
set -x set -x
fi fi
version="210516" version="030616"
#### Variables #### #### Variables ####
@ -58,7 +58,7 @@ githubrepo="linuxgsm"
githubbranch="master" githubbranch="master"
# Steam # Steam
appid="346330" appid="475370"
# Server Details # Server Details
servicename="bb2-server" servicename="bb2-server"

6
lgsm/functions/check_deps.sh

@ -2,7 +2,7 @@
# LGSM check_deps.sh function # LGSM check_deps.sh function
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
lgsm_version="270516" lgsm_version="090616"
# Description: Checks that the requires dependencies are installed for LGSM. # Description: Checks that the requires dependencies are installed for LGSM.
@ -126,7 +126,7 @@ if [ -n "$(command -v dpkg-query)" ]; then
array_deps_missing=() array_deps_missing=()
# LGSM requirement for curl # LGSM requirement for curl
array_deps_required=( curl ca-certificates file ) array_deps_required=( curl ca-certificates file bsdmainutils python )
# All servers except ts3 require tmux # All servers except ts3 require tmux
if [ "${executable}" != "./ts3server_startscript.sh" ]; then if [ "${executable}" != "./ts3server_startscript.sh" ]; then
@ -176,7 +176,7 @@ elif [ -n "$(command -v yum)" ]; then
array_deps_missing=() array_deps_missing=()
# LGSM requirement for curl # LGSM requirement for curl
array_deps_required=( curl ) array_deps_required=( curl util-linux python file )
# All servers except ts3 require tmux # All servers except ts3 require tmux
if [ "${executable}" != "./ts3server_startscript.sh" ]; then if [ "${executable}" != "./ts3server_startscript.sh" ]; then

96
lgsm/functions/command_fastdl.sh

@ -3,7 +3,7 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Contributor: UltimateByte # Contributor: UltimateByte
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
lgsm_version="210216" lgsm_version="060616"
# Description: Creates a FastDL folder # Description: Creates a FastDL folder
@ -25,7 +25,7 @@ fn_check_bzip2(){
# Returns true if not installed # Returns true if not installed
if [ -z "$(command -v bzip2)" ]; then if [ -z "$(command -v bzip2)" ]; then
bzip2installed="0" bzip2installed="0"
fn_printinfo "bzip2 is not installed !" fn_print_info "bzip2 is not installed !"
fn_scriptlog "bzip2 is not installed" fn_scriptlog "bzip2 is not installed"
echo -en "\n" echo -en "\n"
sleep 1 sleep 1
@ -39,7 +39,7 @@ fn_check_bzip2(){
fn_fastdl_init(){ fn_fastdl_init(){
# User confirmation # User confirmation
fn_printok "Welcome to LGSM's FastDL generator" fn_print_ok "Welcome to LGSM's FastDL generator"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
fn_scriptlog "Started FastDL creation" fn_scriptlog "Started FastDL creation"
@ -56,13 +56,13 @@ fn_fastdl_init(){
# Check and create folders # Check and create folders
if [ ! -d "${webdir}" ]; then if [ ! -d "${webdir}" ]; then
echo "" echo ""
fn_printinfo "Creating FastDL directories" fn_print_info "Creating FastDL directories"
echo -en "\n" echo -en "\n"
sleep 1 sleep 1
fn_printdots "Creating www directory" fn_print_dots "Creating www directory"
sleep 0.5 sleep 0.5
mkdir "${webdir}" mkdir "${webdir}"
fn_printok "Created www directory" fn_print_ok "Created www directory"
fn_scriptlog "FastDL created www directory" fn_scriptlog "FastDL created www directory"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
@ -70,10 +70,10 @@ fn_fastdl_init(){
if [ ! -d "${fastdldir}" ]; then if [ ! -d "${fastdldir}" ]; then
# No folder, won't ask for removing old ones # No folder, won't ask for removing old ones
newfastdl=1 newfastdl=1
fn_printdots "Creating fastdl directory" fn_print_dots "Creating fastdl directory"
sleep 0.5 sleep 0.5
mkdir "${fastdldir}" mkdir "${fastdldir}"
fn_printok "Created fastdl directory" fn_print_ok "Created fastdl directory"
fn_scriptlog "FastDL created fastdl directory" fn_scriptlog "FastDL created fastdl directory"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
@ -85,18 +85,18 @@ fn_fastdl_init(){
fn_fastdl_config(){ fn_fastdl_config(){
# Global settings for FastDL creation # Global settings for FastDL creation
fn_printinfo "Entering configuration" fn_print_info "Entering configuration"
fn_scriptlog "Configuration" fn_scriptlog "Configuration"
sleep 2 sleep 2
echo -en "\n" echo -en "\n"
# Prompt for clearing old files if folder was already here # Prompt for clearing old files if folder was already here
if [ -n "${newfastdl}" ] && [ "${newfastdl}" == "0" ]; then if [ -n "${newfastdl}" ] && [ "${newfastdl}" == "0" ]; then
fn_printdots fn_print_dots
while true; do while true; do
read -e -i "y" -p "Clear old FastDL files? [Y/n]" yn read -e -i "y" -p "Clear old FastDL files? [Y/n]" yn
case $yn in case $yn in
[Yy]* ) clearoldfastdl="on"; fn_scriptlog "clearoldfastdl enabled"; fn_printok "Clearing Enabled"; break;; [Yy]* ) clearoldfastdl="on"; fn_scriptlog "clearoldfastdl enabled"; fn_print_ok "Clearing Enabled"; break;;
[Nn]* ) clearoldfastdl="off"; fn_scriptlog "clearoldfastdl disabled"; fn_printok "Clearing Disabled"; break;; [Nn]* ) clearoldfastdl="off"; fn_scriptlog "clearoldfastdl disabled"; fn_print_ok "Clearing Disabled"; break;;
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
@ -104,12 +104,12 @@ fn_fastdl_config(){
fi fi
# Prompt for using bzip2 if it's installed # Prompt for using bzip2 if it's installed
if [ ${bzip2installed} == 1 ]; then if [ ${bzip2installed} == 1 ]; then
fn_printdots fn_print_dots
while true; do while true; do
read -e -i "y" -p "Enable file compression using bzip2? [Y/n]" yn read -e -i "y" -p "Enable file compression using bzip2? [Y/n]" yn
case $yn in case $yn in
[Yy]* ) bzip2enable="on"; fn_scriptlog "bzip2 enabled"; fn_printok "bzip2 Enabled"; break;; [Yy]* ) bzip2enable="on"; fn_scriptlog "bzip2 enabled"; fn_print_ok "bzip2 Enabled"; break;;
[Nn]* ) bzip2enable="off"; fn_scriptlog "bzip2 disabled"; fn_printok "bzip2 Disabled"; break;; [Nn]* ) bzip2enable="off"; fn_scriptlog "bzip2 disabled"; fn_print_ok "bzip2 Disabled"; break;;
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
@ -119,12 +119,12 @@ fn_fastdl_config(){
fn_fastdl_gmod_config(){ fn_fastdl_gmod_config(){
# Prompt for download enforcer, that is using a .lua addfile resource generator # Prompt for download enforcer, that is using a .lua addfile resource generator
fn_printdots fn_print_dots
while true; do while true; do
read -e -i "y" -p "Use client download enforcer? [Y/n]" yn read -e -i "y" -p "Use client download enforcer? [Y/n]" yn
case $yn in case $yn in
[Yy]* ) luaressource="on"; fn_scriptlog "DL enforcer Enabled"; fn_printok "Enforcer Enabled"; break;; [Yy]* ) luaressource="on"; fn_scriptlog "DL enforcer Enabled"; fn_print_ok "Enforcer Enabled"; break;;
[Nn]* ) luaressource="off"; fn_scriptlog "DL enforcer Disabled"; fn_printok "Enforcer Disabled"; break;; [Nn]* ) luaressource="off"; fn_scriptlog "DL enforcer Disabled"; fn_print_ok "Enforcer Disabled"; break;;
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
@ -134,11 +134,11 @@ fn_fastdl_gmod_config(){
fn_clear_old_fastdl(){ fn_clear_old_fastdl(){
# Clearing old FastDL if user answered yes # Clearing old FastDL if user answered yes
if [ "${clearoldfastdl}" == "on" ]; then if [ "${clearoldfastdl}" == "on" ]; then
fn_printinfo "Clearing existing FastDL folder" fn_print_info "Clearing existing FastDL folder"
fn_scriptlog "Clearing existing FastDL folder" fn_scriptlog "Clearing existing FastDL folder"
sleep 0.5 sleep 0.5
rm -R "${fastdldir:?}"/* rm -R "${fastdldir:?}"/*
fn_printok "Old FastDL folder cleared" fn_print_ok "Old FastDL folder cleared"
fn_scriptlog "Old FastDL folder cleared" fn_scriptlog "Old FastDL folder cleared"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
@ -148,7 +148,7 @@ fn_clear_old_fastdl(){
fn_gmod_fastdl(){ fn_gmod_fastdl(){
# Copy all needed files for FastDL # Copy all needed files for FastDL
echo "" echo ""
fn_printdots "Starting gathering all needed files" fn_print_dots "Starting gathering all needed files"
fn_scriptlog "Starting gathering all needed files" fn_scriptlog "Starting gathering all needed files"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
@ -157,64 +157,64 @@ fn_gmod_fastdl(){
cd "${systemdir}" cd "${systemdir}"
# Map Files # Map Files
fn_printdots "Copying map files..." fn_print_dots "Copying map files..."
fn_scriptlog "Copying map files" fn_scriptlog "Copying map files"
sleep 0.5 sleep 0.5
find . -name '*.bsp' | cpio --quiet -updm "${fastdldir}" find . -name '*.bsp' | cpio --quiet -updm "${fastdldir}"
fn_printok "Map files copied" fn_print_ok "Map files copied"
sleep 0.5 sleep 0.5
echo -en "\n" echo -en "\n"
# Materials # Materials
fn_printdots "Copying materials..." fn_print_dots "Copying materials..."
fn_scriptlog "Copying materials" fn_scriptlog "Copying materials"
sleep 0.5 sleep 0.5
find . -name '*.vtf' | cpio --quiet -updm "${fastdldir}" find . -name '*.vtf' | cpio --quiet -updm "${fastdldir}"
find . -name '*.vmt' | cpio --quiet -updm "${fastdldir}" find . -name '*.vmt' | cpio --quiet -updm "${fastdldir}"
fn_printok "Materials copied" fn_print_ok "Materials copied"
sleep 0.5 sleep 0.5
echo -en "\n" echo -en "\n"
# Models # Models
fn_printdots "Copying models..." fn_print_dots "Copying models..."
fn_scriptlog "Copying models" fn_scriptlog "Copying models"
sleep 1 sleep 1
find . -name '*.vtx' | cpio --quiet -updm "${fastdldir}" find . -name '*.vtx' | cpio --quiet -updm "${fastdldir}"
find . -name '*.vvd' | cpio --quiet -updm "${fastdldir}" find . -name '*.vvd' | cpio --quiet -updm "${fastdldir}"
find . -name '*.mdl' | cpio --quiet -updm "${fastdldir}" find . -name '*.mdl' | cpio --quiet -updm "${fastdldir}"
find . -name '*.phy' | cpio --quiet -updm "${fastdldir}" find . -name '*.phy' | cpio --quiet -updm "${fastdldir}"
fn_printok "Models copied" fn_print_ok "Models copied"
sleep 0.5 sleep 0.5
echo -en "\n" echo -en "\n"
# Particles # Particles
fn_printdots "Copying particles..." fn_print_dots "Copying particles..."
fn_scriptlog "Copying particles" fn_scriptlog "Copying particles"
sleep 0.5 sleep 0.5
find . -name '*.pcf' | cpio --quiet -updm "${fastdldir}" find . -name '*.pcf' | cpio --quiet -updm "${fastdldir}"
fn_printok "Particles copied" fn_print_ok "Particles copied"
sleep 0.5 sleep 0.5
echo -en "\n" echo -en "\n"
# Sounds # Sounds
fn_printdots "Copying sounds..." fn_print_dots "Copying sounds..."
fn_scriptlog "Copying sounds" fn_scriptlog "Copying sounds"
sleep 0.5 sleep 0.5
find . -name '*.wav' | cpio --quiet -updm "${fastdldir}" find . -name '*.wav' | cpio --quiet -updm "${fastdldir}"
find . -name '*.mp3' | cpio --quiet -updm "${fastdldir}" find . -name '*.mp3' | cpio --quiet -updm "${fastdldir}"
find . -name '*.ogg' | cpio --quiet -updm "${fastdldir}" find . -name '*.ogg' | cpio --quiet -updm "${fastdldir}"
fn_printok "Sounds copied" fn_print_ok "Sounds copied"
sleep 0.5 sleep 0.5
echo -en "\n" echo -en "\n"
# Resources (mostly fonts) # Resources (mostly fonts)
fn_printdots "Copying fonts and png..." fn_print_dots "Copying fonts and png..."
fn_scriptlog "Copying fonts and png" fn_scriptlog "Copying fonts and png"
sleep 1 sleep 1
find . -name '*.otf' | cpio --quiet -updm "${fastdldir}" find . -name '*.otf' | cpio --quiet -updm "${fastdldir}"
find . -name '*.ttf' | cpio --quiet -updm "${fastdldir}" find . -name '*.ttf' | cpio --quiet -updm "${fastdldir}"
find . -name '*.png' | cpio --quiet -updm "${fastdldir}" find . -name '*.png' | cpio --quiet -updm "${fastdldir}"
fn_printok "Fonts and png copied" fn_print_ok "Fonts and png copied"
sleep 0.5 sleep 0.5
echo -en "\n" echo -en "\n"
@ -223,22 +223,22 @@ fn_gmod_fastdl(){
# Correct addons folder structure for FastDL # Correct addons folder structure for FastDL
if [ -d "${fastdldir}/addons" ]; then if [ -d "${fastdldir}/addons" ]; then
fn_printinfo "Adjusting addons' file structure" fn_print_info "Adjusting addons' file structure"
fn_scriptlog "Adjusting addon's file structure" fn_scriptlog "Adjusting addon's file structure"
sleep 1 sleep 1
cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}"
#Don't remove yet rm -R "${fastdldir:?}/addons" #Don't remove yet rm -R "${fastdldir:?}/addons"
fn_printok "Adjusted addon's file structure" fn_print_ok "Adjusted addon's file structure"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
fi fi
# Correct content that may be into a lua folder by mistake like some darkrpmodification addons # Correct content that may be into a lua folder by mistake like some darkrpmodification addons
if [ -d "${fastdldir}/lua" ]; then if [ -d "${fastdldir}/lua" ]; then
fn_printdots "Typical DarkRP shit detected, fixing" fn_print_dots "Typical DarkRP shit detected, fixing"
sleep 2 sleep 2
cp -Rf "${fastdldir}/lua/"* "${fastdldir}" cp -Rf "${fastdldir}/lua/"* "${fastdldir}"
fn_printok "Stupid DarkRP file structure fixed" fn_print_ok "Stupid DarkRP file structure fixed"
sleep 2 sleep 2
echo -en "\n" echo -en "\n"
fi fi
@ -250,10 +250,10 @@ fn_lua_fastdl(){
echo "" echo ""
if [ "${luaressource}" == "off" ]; then if [ "${luaressource}" == "off" ]; then
if [ -f "${luafastdlfullpath}" ]; then if [ -f "${luafastdlfullpath}" ]; then
fn_printdots "Removing download enforcer" fn_print_dots "Removing download enforcer"
sleep 1 sleep 1
rm -R "${luafastdlfullpath:?}" rm -R "${luafastdlfullpath:?}"
fn_printok "Removed download enforcer" fn_print_ok "Removed download enforcer"
fn_scriptlog "Removed old download inforcer" fn_scriptlog "Removed old download inforcer"
echo -en "\n" echo -en "\n"
sleep 2 sleep 2
@ -262,22 +262,22 @@ fn_lua_fastdl(){
# Remove old lua file and generate a new one if user said yes # Remove old lua file and generate a new one if user said yes
if [ "${luaressource}" == "on" ]; then if [ "${luaressource}" == "on" ]; then
if [ -f "${luafastdlfullpath}" ]; then if [ -f "${luafastdlfullpath}" ]; then
fn_printdots "Removing old download enforcer" fn_print_dots "Removing old download enforcer"
sleep 1 sleep 1
rm "${luafastdlfullpath}" rm "${luafastdlfullpath}"
fn_printok "Removed old download enforcer" fn_print_ok "Removed old download enforcer"
fn_scriptlog "Removed old download enforcer" fn_scriptlog "Removed old download enforcer"
echo -en "\n" echo -en "\n"
sleep 1 sleep 1
fi fi
fn_printdots "Generating new download enforcer" fn_print_dots "Generating new download enforcer"
fn_scriptlog "Generating new download enforcer" fn_scriptlog "Generating new download enforcer"
sleep 1 sleep 1
# Read all filenames and put them into a lua file at the right path # Read all filenames and put them into a lua file at the right path
find "${fastdldir}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do find "${fastdldir}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do
echo "resource.AddFile( "\""${line}"\"" )" >> ${luafastdlfullpath} echo "resource.AddFile( "\""${line}"\"" )" >> ${luafastdlfullpath}
done done
fn_printok "Download enforcer generated" fn_print_ok "Download enforcer generated"
fn_scriptlog "Download enforcer generated" fn_scriptlog "Download enforcer generated"
echo -en "\n" echo -en "\n"
echo "" echo ""
@ -289,14 +289,14 @@ fn_fastdl_bzip2(){
# Compressing using bzip2 if user said yes # Compressing using bzip2 if user said yes
echo "" echo ""
if [ ${bzip2enable} == "on" ]; then if [ ${bzip2enable} == "on" ]; then
fn_printinfo "Have a break, this step could take a while..." fn_print_info "Have a break, this step could take a while..."
echo -en "\n" echo -en "\n"
echo "" echo ""
fn_printdots "Compressing files using bzip2..." fn_print_dots "Compressing files using bzip2..."
fn_scriptlog "Compressing files using bzip2..." fn_scriptlog "Compressing files using bzip2..."
# bzip2 all files that are not already compressed (keeping original files) # bzip2 all files that are not already compressed (keeping original files)
find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec bzip2 -qk \{\} \; find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec bzip2 -qk \{\} \;
fn_printok "bzip2 compression done" fn_print_ok "bzip2 compression done"
fn_scriptlog "bzip2 compression done" fn_scriptlog "bzip2 compression done"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
@ -306,12 +306,12 @@ fn_fastdl_bzip2(){
fn_fastdl_completed(){ fn_fastdl_completed(){
# Finished message # Finished message
echo "" echo ""
fn_printok "Congratulations, it's done !" fn_print_ok "Congratulations, it's done !"
fn_scriptlog "FastDL job done" fn_scriptlog "FastDL job done"
sleep 2 sleep 2
echo -en "\n" echo -en "\n"
echo "" echo ""
fn_printinfo "Need more doc ? See https://github.com/dgibbs64/linuxgsm/wiki/FastDL" fn_print_info "Need more doc ? See https://github.com/dgibbs64/linuxgsm/wiki/FastDL"
echo -en "\n" echo -en "\n"
if [ "$bzip2installed" == "0" ]; then if [ "$bzip2installed" == "0" ]; then
echo "By the way, you'd better install bzip2 an re-run this command !" echo "By the way, you'd better install bzip2 an re-run this command !"

4
lgsm/functions/command_stop.sh

@ -2,7 +2,7 @@
# LGSM command_stop.sh function # LGSM command_stop.sh function
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
lgsm_version="210516" lgsm_version="050616"
# Description: Stops the server. # Description: Stops the server.
@ -32,9 +32,9 @@ fn_stop_graceful_source(){
fn_print_fail "Graceful: rcon quit: " fn_print_fail "Graceful: rcon quit: "
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_scriptlog "Graceful: rcon quit: FAIL" fn_scriptlog "Graceful: rcon quit: FAIL"
fn_stop_tmux
fi fi
sleep 1 sleep 1
fn_stop_tmux
} }
# Attempts Graceful of goldsource using rcon 'quit' command. # Attempts Graceful of goldsource using rcon 'quit' command.

2
lgsm/functions/fix_ins.sh

@ -8,7 +8,7 @@ lgsm_version="210516"
# Resolves ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory # Resolves ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory
export LD_LIBRARY_PATH=:${filesdir}:${filesdir}/bin:{$LD_LIBRARY_PATH} export LD_LIBRARY_PATH=${filesdir}:${filesdir}/bin:${LD_LIBRARY_PATH}
# fix for issue #529 - gamemode not passed to debug or start # fix for issue #529 - gamemode not passed to debug or start

2
lgsm/functions/update_check.sh

@ -169,7 +169,7 @@ fn_steamcmdcheck(){
fn_scriptlog "${currentbuild} > ${availablebuild}" fn_scriptlog "${currentbuild} > ${availablebuild}"
unset updateonstart unset updateonstart
info_status.sh check_status.sh
if [ "${status}" != "0" ]; then if [ "${status}" != "0" ]; then
command_stop.sh command_stop.sh
update_dl.sh update_dl.sh

Loading…
Cancel
Save