fix: [installer] Currently misp-packer fails on waiting for user input during upgrade

pull/4788/head
Steve Clement 2019-06-20 13:59:31 +09:00
parent 4b5f36fcd3
commit 444b3f9c05
No known key found for this signature in database
GPG Key ID: 69A20F509BE4AEE9
1 changed files with 10 additions and 1 deletions

View File

@ -46,7 +46,16 @@ aptUpgrade () {
debug "Upgrading system"
checkAptLock
sudo apt-get update
sudo apt-get upgrade -qy
# If we run in non-interactive mode, make sure we do not stop all of a sudden
if [[ "${PACKER}" == "1" || "${UNATTENDED}" == "1" ]]; then
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
sudo -E apt-get -qy -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" upgrade
sudo -E apt-get -qy autoclean
else
sudo apt-get upgrade -qy
fi
}
# <snippet-end 0_apt-upgrade.sh>
```