16 lines
374 B
Bash
Executable File
16 lines
374 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "$#" -ne 1 ]; then
|
|
echo "$(tput setaf 1)No repo name specified$(tput sgr0)"
|
|
echo "Usage: $0 <repo name>"
|
|
exit 1
|
|
else
|
|
# Assign the directory to a variable
|
|
REPO_PATH=/mnt/backups/$1
|
|
echo -e "Creating $(tput setaf 4)$REPO_PATH$(tput sgr0)"
|
|
fi
|
|
|
|
docker run -it --rm \
|
|
-v /mnt/backups:/mnt/backups \
|
|
restic/restic \
|
|
init --repo $REPO_PATH |