#!/bin/sh
# shellcheck disable=SC1091
. /etc/os-release

if [ "${ID}" = "arch" ]; then
    pacman -Syu --noconfirm
    pacman -Sc --noconfirm
elif [ "${ID}" = "ubuntu" ] || [ "${ID}" = "debian" ] || [ "${ID}" = "elementary" ]; then
    apt-get update
    apt-get dist-upgrade -y
    apt-get autoremove --purge -y
elif [ "${ID}" = "ubuntu-core" ]; then
    snap refresh
elif [ "${ID}" = "fedora" ]; then
    dnf upgrade --refresh -y
elif [ "${ID}" = "centos" ]; then
    yum upgrade -y
elif [ "${ID}" = "opensuse" ]; then
    zypper update -y
elif [ "${ID}" = "opensuse-tumbleweed" ]; then
    zypper update -y
elif [ "${ID}" = "solus" ]; then
    eopkg update-repo -y
    eopkg upgrade -y
fi
