restore can be run from backup dir

This commit is contained in:
Andrew Hurley 2022-12-26 12:26:30 +11:00
parent dc6857fcdd
commit a746f94e41
1 changed files with 5 additions and 17 deletions

22
vvv.sh
View File

@ -28,23 +28,6 @@ while getopts ':rd' OPT; do
done
shift $((OPTIND -1))
if [[ $RESTORE == "true" ]] && [[ ! -f docker-restore.sh ]]; then
echo "Problem: docker-restore.sh missing!"
exit 1
fi
ccheck () {
printf "${OUTPUT}\n"
REPLY=$'\n'
timeout 10 bash -c 'read -r -s -N 1 -p "Starting delay of 10 seconds. Press 'Escape' or 'q' to cancel..."'
if [[ $REPLY != $'\n' ]]; then
printf "${OUTPUT} cancelled.\n"
return 1
else
printf "${OUTPUT} starting.\n"
fi
}
scripts () {
for MODE in backup restore; do
FILE="docker-${MODE}.sh"
@ -104,6 +87,11 @@ USER=$(stat -c '%u' $BASH_SOURCE)
pushd "../${PROJECT}" > /dev/null || exit 1
if [[ $RESTORE == "true" ]] && [[ ! -f docker-restore.sh ]]; then
echo "Problem: docker-restore.sh missing!"
exit 1
fi
if [[ ! $RESTORE == "true" ]]; then
scripts
fi