Couple more changes coming...
Here it is in 9.0.9-5, but the progress bar doesn't work.
- Code: Select all
# Check disk space on mounted /, /home, /media, /mnt, /tmp
check_space () {
disk_space=$(df -h -x tmpfs -x devtmpfs -x iso9660 | awk '{ print " " $2 "\t" $3 "\t" $4 "\t" $5 " \t" $6 "\t\t\t" $1 }' | tee >($DIALOG --title="Checking disk space..." --progress --pulsate --auto-close --width 300) ;)
}
Get rid of everything after the pipe (except the closing parenthesis.)
Move the progress bar down to where check_space is called, around line 367, remove '--auto-close' and kill it before the report window comes up:
- Code: Select all
# These functions create the information window
$DIALOG --title="Checking disk space..." --progress --pulsate --width 300
check_copies
check_directories
check_space
kill $(pgrep $DIALOG)
report_space
Also fixed $snapshot_count. This is part of the check_copies function, around line 170. Changed this, which works in terminal but not in a script
- Code: Select all
if [[ -d $snapshot_dir ]]; then
if [[ -e "$snapshot_dir"/*.iso ]] ; then
snapshot_count=$(ls "$snapshot_dir"/*.iso | wc -l)
To this, which works in the script
- Code: Select all
# Check how many snapshots already exist and their total size
if [[ -d $snapshot_dir ]]; then
if ls "$snapshot_dir"/*.iso > /dev/null ; then
snapshot_count=$(ls "$snapshot_dir"/*.iso | wc -l)