restore can be run from backup dir
This commit is contained in:
parent
dc6857fcdd
commit
a746f94e41
22
vvv.sh
22
vvv.sh
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue