template_setup/110-Cleanup.sh
deathbybandaid b7ef0296c6 test
2023-12-17 11:43:58 -05:00

23 lines
828 B
Bash

#!/bin/bash
## Script Location
SCRIPTDIR=$(dirname $0)
source "$SCRIPTDIR/common/colors.sh"
source "$SCRIPTDIR/common/functions.sh"
source "$SCRIPTDIR/common/load-defaults.sh"
printf "$COL_LIGHT_BLUE" "* Cleaning up system"
prespace=$(get_system_used_space)
printf "$COL_LIGHT_BLUE" "* Current used space is $prespace"
prespacewords=`human_readable_bytes $prespace`
printf "$COL_LIGHT_BLUE" "* Current used space is $prespacewords"
pkgmgr_clean
postspace=$(get_system_used_space)
printf "$COL_LIGHT_BLUE" "* Current used space is now $postspace"
postspacewords=`human_readable_bytes $prespace`
printf "$COL_LIGHT_BLUE" "* Current used space is now $postspacewords"
spacesavedbytes=`expr $postspace - $prespace`
postspacewords=`(human_readable_bytes $spacesavedbytes`
printf "$COL_LIGHT_BLUE" "Cleanup saved $spacesavedwords"