#!/bin/bash

## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
shopt -s inherit_errexit
shopt -s shift_verbose

POLICYRCD="${POLICYRCD:-/usr/share/helper-scripts/policy-rc.d}"
DEBIAN_FRONTEND="${DEBIAN_FRONTEND:-noninteractive}"
DEBIAN_PRIORITY="${DEBIAN_PRIORITY:-critical}"
DEBCONF_NOWARNINGS="${DEBCONF_NOWARNINGS:-yes}"
APT_LISTCHANGES_FRONTEND="${APT_LISTCHANGES_FRONTEND:-text}"
NEEDRESTART_MODE="${NEEDRESTART_MODE:-l}"

export POLICYRCD DEBIAN_FRONTEND DEBIAN_PRIORITY DEBCONF_NOWARNINGS APT_LISTCHANGES_FRONTEND NEEDRESTART_MODE

## Why we are not using the 'apt-get' option '--yes'?
## See 'man/apt-get-noninteractive.8.ronn' or 'man apt-get-noninteractive'.
apt-get -o Dpkg::Options::="--force-confask,confnew,confmiss" "$@"
