Allow non-empty backupAllMaps / includeAutoBackups

Suggested in https://github.com/FezVrasta/ark-server-tools/pull/1059#discussion_r378030037
This commit is contained in:
Ben Peddell 2020-02-14 02:03:42 +10:00 committed by GitHub
parent 092b92e1dd
commit fdff30450f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2842,7 +2842,9 @@ doBackup(){
for arg in "$@"; do
case "$arg" in
--allmaps) backupAllMaps=true; ;;
--no-allmaps) backupAllMaps=false; ;;
--autobackups) includeAutoBackups=true; ;;
--no-autobackups) includeAutoBackups=false; ;;
*)
echo "Unrecognized option $arg"
echo "Try 'arkmanager -h' or 'arkmanager --help' for more information."
@ -2891,7 +2893,7 @@ doBackup(){
fi
# Copy other world files
if [ "$backupAllMaps" == "true" ]; then
if [ -n "$backupAllMaps" ] && [ "$backupAllMaps" != "false" ]; then
echo -e "${NORMAL} Copying other ARK world files"
for f in "${savedir}/"*.ark; do
if [[ "${f}" != "${mapfile}" && "${f}" != "${savedir}/"*_??.??.????_??.??.??.ark ]]; then
@ -2901,7 +2903,7 @@ doBackup(){
fi
# Copy map autobackups
if [ "$includeAutoBackups" == "true" ]; then
if [ -n "$includeAutoBackups" ] && [ "$includeAutoBackups" != "false" ]; then
echo -e "${NORMAL} Copying all ARK world autobackup files"
for f in "${savedir}/"*.ark; do
if [[ "${f}" == "${savedir}/"*_??.??.????_??.??.??.ark ]]; then