backup-docker/entrypoint.sh

43 lines
589 B
Bash
Raw Normal View History

2022-03-27 00:31:46 +00:00
#!/usr/bin/env sh
set -e
COMMAND="$1"
# print usage if no command is given
if [ -z "$COMMAND" ]; then
echo "Usage: $0 <command>"
echo "Available commands:"
echo " backup"
echo " restore"
echo " init TODO"
echo " interactive"
exit 1
fi
. /app/setup.sh
case "$COMMAND" in
backup)
# backup
/app/backup.sh
;;
restore)
# restore
/app/restore.sh
;;
init)
# init
# TODO: implement
/app/init.sh
;;
interactive)
# interactive
/app/interactive.sh
;;
*)
echo "Unknown command: $COMMAND"
exit 1
;;
esac