Browse Source

Merged hotfix-pzserver into develop

pull/1197/merge
Daniel Gibbs 9 years ago
parent
commit
bab3ef6403
  1. 6
      ProjectZomboid/pzserver
  2. 22
      lgsm/functions/command_backup.sh
  3. 1
      lgsm/functions/install_config.sh

6
ProjectZomboid/pzserver

@ -27,7 +27,7 @@ adminpassword="CHANGE_ME"
ip="0.0.0.0"
fn_parms(){
parms="-ip ${ip} -adminpassword \"${adminpassword}\""
parms="-ip ${ip} -adminpassword \"${adminpassword}\" -servername ${servicename}"
}
#### LinuxGSM Settings ####
@ -96,8 +96,8 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}"
executabledir="${filesdir}"
executable="./start-server.sh"
servercfg="server.ini"
servercfgdefault="server.cfg"
servercfg="${servicename}.ini"
servercfgdefault="server.ini"
servercfgdir="${HOME}/Zomboid/Server"
servercfgfullpath="${servercfgdir}/${servercfg}"

22
lgsm/functions/command_backup.sh

@ -127,18 +127,20 @@ fn_backup_compression(){
fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
fi
# Remove lock file
rm -f "${tmpdir}/.backup.lock"
}
# Clear old backups according to maxbackups and maxbackupdays variables
fn_backup_prune(){
# How many backups there are
info_distro.sh
# How many backups exceed maxbackups
backupquotadiff=$((backupcount-maxbackups))
# How many backups exceed maxbackupdays
backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.gz" -mtime +"${maxbackupdays}"|wc -l)
# If backup variables are set
if [ -n "${maxbackupdays}" ]&&[ -n "${maxbackups}" ]; then
# Clear if backup variables are set
if [ -n "${maxbackups}" ]&&[ -n "${maxbackupdays}" ]; then
# How many backups there are
info_distro.sh
# How many backups exceed maxbackups
backupquotadiff=$((backupcount-maxbackups))
# How many backups exceed maxbackupdays
backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.gz" -mtime +"${maxbackupdays}"|wc -l)
# If anything can be cleared
if [ "${backupquotadiff}" -gt "0" ]||[ "${backupsoudatedcount}" -gt "0" ]; then
fn_print_dots "Pruning"
@ -195,8 +197,4 @@ fn_backup_dir
fn_backup_compression
fn_backup_prune
fn_backup_start_server
# Remove lock file
rm -f "${tmpdir}/.backup.lock"
core_exit.sh

1
lgsm/functions/install_config.sh

@ -298,6 +298,7 @@ elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then
fn_set_config_vars
elif [ "${gamename}" == "Project Zomboid" ]; then
gamedirname="ProjectZomboid"
fn_check_cfgdir
array_configs+=( server.ini )
fn_fetch_default_config
fn_default_config_remote

Loading…
Cancel
Save