#!/bin/bash

# Exit script if command fails
# -u stops the script on unset variables
# -e stops the script on errors
# -o pipefail stops the script if a pipe fails
set -e

REPOSITORY=https://raw.githubusercontent.com/mint-system/ansible-build

SCRIPTS=(
    docker-postgres-backup
    docker-postgres-list
    docker-postgres-restore
    docker-postgres-drop
    docker-postgres-patch
    docker-postgres-duplicate
    docker-postgres-size
)

for SCRIPT in ${SCRIPTS[@]}; do
    echo "Install $SCRIPT script ..."
    sudo curl -L "$REPOSITORY/master/roles/postgres/files/$SCRIPT" -o "/usr/local/bin/$SCRIPT"
    sudo chmod +x "/usr/local/bin/$SCRIPT"
done
