parent
43b1617679
commit
7aaff1f1dc
@ -1,20 +1,28 @@
|
||||
#!/bin/bash
|
||||
src=$(pwd)
|
||||
pushd .. 2&> /dev/null
|
||||
echo "Uninstalling files..."
|
||||
ls -lAp $src | grep "^-" | awk '{print $9}' | xargs -n 1 -I file rm -f file
|
||||
dest=$(pwd)
|
||||
|
||||
echo ""
|
||||
echo "Restoring from home bkup..."
|
||||
ls -lA ./home_bkup | grep "^-" | awk '{print $9}' | xargs -n 1 -P 8 -I file cp home_bkup/file file
|
||||
if [[ -d "$dest/.home_bkup" ]]; then
|
||||
echo "Uninstalling files from ${dest}..."
|
||||
ls -lAp $src | grep "^-" | awk '{print $9}' | xargs -n 1 -I file rm -f $dest/file
|
||||
echo ""
|
||||
|
||||
echo ""
|
||||
echo "Cleaning up home backup and tools..."
|
||||
rm -rf ./home_bkup
|
||||
rm -rf ./tools
|
||||
echo "Restoring from .home_bkup..."
|
||||
ls -lA ./.home_bkup | grep "^-" | awk '{print $9}' | xargs -n 1 -P 8 -I file cp ./.home_bkup/file ./file
|
||||
echo ""
|
||||
|
||||
popd 2&> /dev/null
|
||||
echo ""
|
||||
echo ".ssh config has been left alone"
|
||||
echo ""
|
||||
echo "Restore completed"
|
||||
echo "Cleaning up home backup and tools..."
|
||||
rm -rf ./.home_bkup
|
||||
rm -rf ./tools
|
||||
|
||||
popd 2&> /dev/null
|
||||
echo ""
|
||||
|
||||
echo ".ssh config has been left alone"
|
||||
echo ""
|
||||
|
||||
echo "Restore completed!"
|
||||
else
|
||||
echo "you don't have a home backup, aborting"
|
||||
fi
|
||||
|
Loading…
Reference in new issue