photoprism/scripts/init/dist-upgrade.sh
2022-02-18 17:40:58 +01:00

20 lines
No EOL
351 B
Bash
Executable file

#!/usr/bin/env bash
# abort if the user is not root
if [[ $(id -u) != "0" ]]; then
echo "Usage: run dist-upgrade.sh as root" 1>&2
exit 1
fi
# fail on errors
set -eu
# disable user interactions
export DEBIAN_FRONTEND="noninteractive"
export TMPDIR="/tmp"
apt-get -y update
apt-get -y dist-upgrade
apt-get -y autoremove
echo "Packages updated."