Full qualify paths.

This commit is contained in:
awalsh128 2021-10-16 21:23:27 -07:00
parent 6c13cf414f
commit e558e74c19

View file

@ -9,11 +9,16 @@ cache_dir=$1
# Typically filesystem root '/' but can be changed for testing. # Typically filesystem root '/' but can be changed for testing.
cache_restore_root=$2 cache_restore_root=$2
for cache_filepath in $(ls $cache_dir); do cache_filenames=$(ls -1 $cache_dir | sort)
echo "* Found ${#cache_filenames[@]} files in cache..."
echo $cache_filenames
for cache_filename in $cache_filenames; do
cache_filepath=$cache_dir/$cache_filename
echo "* Restoring $cache_filepath from cache... " echo "* Restoring $cache_filepath from cache... "
sudo tar -xf $cache_filepath -C $cache_restore_root sudo tar -xf $cache_filepath -C $cache_restore_root
done done
# Update all packages. # Update all packages.
sudo apt-get --yes --only-upgrade install sudo apt-get --yes --only-upgrade install
echo "Action complete. $(ls -l $cache_dir | wc -l) package(s) restored." echo "Action complete. $(echo $cache_filenames | wc -l) package(s) restored."