#!/usr/bin/env bash

if [ -t 1 ]; then
    if command -v tput &>/dev/null; then
        BOLD="$(tput bold)" RED="$(tput setaf 1)" GREEN="$(tput setaf 2)" YELLOW="$(tput setaf 3)" BLUE="$(tput setaf 4)"
        PURPLE="$(tput setaf 5)" MAGENTA="$(tput setaf 5)" CYAN="$(tput setaf 6)" WHITE="$(tput setaf 7)"
        RESET="$(tput sgr0)" NORMAL="$(tput sgr0)"
    else
        BOLD='\033[1m' RED='\033[00;31m' GREEN='\033[00;32m' YELLOW='\033[00;33m' BLUE='\033[00;34m'
        PURPLE='\033[00;35m' MAGENTA='\033[00;35m' CYAN='\033[00;36m' WHITE='\033[01;37m'
        RESET='\033[0m' NORMAL='\033[0m'
    fi
else
    BOLD="" RED="" GREEN="" YELLOW="" BLUE=""
    MAGENTA="" CYAN="" WHITE="" RESET=""
fi

set -e

>&2 echo -e "${BOLD}${YELLOW} [ IMPORTANT ] The package 'privex-repo' has been installed/upgraded.${RESET}"
>&2 echo -e "${BOLD}${YELLOW} [ IMPORTANT ] You should run 'apt update' once this apt command has finished, to download the latest" \
            "package information from http://apt.privex.io${RESET}"

