43 lines
589 B
Bash
43 lines
589 B
Bash
|
#!/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
|