#!/bin/bash
set -e
set -o pipefail  # fail if command before pipe fails

ACTION="$1"

if [ "$ACTION" == "upgrade" -o "$ACTION" == "dist-upgrade" -o "$ACTION" == "full-upgrade" ]; then
    echo "WARNING: This command is not supported to upgrade Wazo. Please use 'wazo-upgrade' instead."
    read -p 'Do you want to execute anyway (this may break your Wazo installation) [y/N]? ' answer

    answer="${answer:-N}"
    if [ "$answer" != 'y' -a "$answer" != 'Y' ]; then
        exit 1
    fi
fi

apt $@
