Bläddra i källkod

typo and spacing

UltimateByte 9 år sedan
förälder
incheckning
119a2cefa0
1 ändrade filer med 5 tillägg och 7 borttagningar
  1. 5 7
      lgsm/functions/command_backup.sh

+ 5 - 7
lgsm/functions/command_backup.sh

@@ -9,8 +9,9 @@ local commandaction="Backup"
 local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
+backuplock=
 # Check if a backup is pending or has been aborted using .backup.lock
-if [ -f "${tmdpdir}/.backup.lock" ]; then
+if [ -f "${tmpdir}/.backup.lock" ]; then
 	fn_print_warning_nl "A backup is currently pending or has been aborted."
 	while true; do
 		read -e -i "y" -p "Continue anyway? [Y/N]" yn
@@ -29,7 +30,6 @@ backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')"
 # Tells how much will be compressed using rootdirduexbackup value from info_distro
 fn_print_info_nl "A total of ${rootdirduexbackup} will be compressed into the following backup:"
 echo "${backupdir}/${backupname}.tar.gz"
-echo ""
 while true; do
 	read -e -i "y" -p "Continue? [Y/N]" yn
 	case $yn in
@@ -38,7 +38,6 @@ while true; do
 	* ) echo "Please answer yes or no.";;
 esac
 done
-echo ""
 check_status.sh
 if [ "${status}" != "0" ]; then
 	echo ""
@@ -61,11 +60,11 @@ if [ ! -d "${backupdir}" ]; then
 	mkdir "${backupdir}"
 fi
 # Create lockfile
-touch "${tmdpdir}/.backup.lock"
+touch "${tmpdir}/.backup.lock"
 # Compressing files
 tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "backups" ./*
 # Remove lockfile
-rm "${tmdpdir}/.backup.lock"
+rm "${tmpdir}/.backup.lock"
 # Check tar exit code and act accordingly
 if [ $? == 0 ]; then
 	fn_print_ok_nl "Backup created: ${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
@@ -101,6 +100,5 @@ else
 	fn_print_error_nl "Backup failed: ${backupname}.tar.gz"
 	fn_script_log_error "Backup failed: ${backupname}.tar.gz"
 fi
-sleep 1
-echo ""
+sleep 0.5
 core_exit.sh