From 8d948d7af6c8b4d6b4c71aead53e95c5b704d270 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sun, 19 Dec 2021 15:25:16 -0600 Subject: [PATCH] Bug fixes --- CentOS/7-Days-To-Die/7D2D-Manage.bash | 19 +++++++++++-------- Misc/Arch-LuksCrpy-Install.bash | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CentOS/7-Days-To-Die/7D2D-Manage.bash b/CentOS/7-Days-To-Die/7D2D-Manage.bash index 520c0a1..24f4e55 100644 --- a/CentOS/7-Days-To-Die/7D2D-Manage.bash +++ b/CentOS/7-Days-To-Die/7D2D-Manage.bash @@ -279,16 +279,19 @@ update() { # Kill the server to ensure a smooth update kill_server -s "${server_id}" >/dev/null 2>&1 + local backup_dir + local backup_full_path local server_directory local server_name - local server_mods_urls server_name="Server-${server_id}" server_directory="${BASE_DIR}/${server_name}" - server_mods_directory="${server_directory}/Mods" - server_mods_urls="${server_directory}/mods.urls" - log "debug" "Created mods directory if it didn't exist" - mkdir -p "${server_mods_directory}" - + backup_dir="${HOME}/Server-Backups/${server_name}" + backup_full_path="${backup_dir}/$(date +%s).tar.gz" + log "info" "Backing up server $(important "${server_name}") to $(important "${backup_full_path}"), this may take a while" + mkdir -p "${backup_dir}" + tar cf - "${server_directory}" -P | pv -s $(du -sb "${server_directory}" | awk '{print $1}') | \ + gzip > "${backup_full_path}" + tar -czf "${server_directory}" "${backup_dir}"/ log "info" "Updating server $(important "${server_name}") located at $(important "${server_directory}")..." steamcmd +login anonymous +force_install_dir "${server_directory}" +app_update 294420 validate +quit @@ -304,7 +307,7 @@ list_servers() { -h | -\? | --help) printf "Usage: %s\n" \ "list [OPTIONS] - --running | -r + --running | -r Lists the currently running 7 Days To Die Servers Example: @@ -334,7 +337,7 @@ list_servers() { esac shift done - + [[ -z "${picked_option}" ]] && log "error" "An option must be passed for list, check list -h" && return 1 diff --git a/Misc/Arch-LuksCrpy-Install.bash b/Misc/Arch-LuksCrpy-Install.bash index d9388c7..f89edbf 100755 --- a/Misc/Arch-LuksCrpy-Install.bash +++ b/Misc/Arch-LuksCrpy-Install.bash @@ -203,7 +203,7 @@ install() { list_disks "${available_disks}" read -p "Select a disk number to install arch linux to: " disk_selected - if [ ${disk_selected} -eq ${disk_selected} 2> /dev/null ]; then + if ${disk_selected} -eq ${disk_selected} 2> /dev/null; then : else log "error" "A number was not passed" @@ -322,7 +322,7 @@ __EOF__ systemctl enable NetworkManager __END_CHROOT_CMDS__ log "info" "Next steps: update localities if incorrect, add your user, update the root password" - log "info" "Notice default login is the following, username: $(important "root") password: $(important "toor")" + log "info" "Notice default login is the following, username: $(important "root") password: $(important "toor") } main() {