#!/bin/sh
set -e
case "$1" in
    configure)
        CODENAME=$(. /etc/os-release && echo "$VERSION_CODENAME")
        cat << SOURCES > /etc/apt/sources.list.d/sixfab.sources
# This file is automatically generated by the apt-repo-sixfab package.
# Do not edit this file manually.
Types: deb
URIs: https://sixfab.github.io/sixfab_dx
Suites: ${CODENAME}
Components: main
Signed-By: /usr/share/keyrings/sixfab-repository-keyring.pgp
SOURCES
        if [ -z "$2" ]; then
            echo "Sixfab DX APT repository added. Run 'sudo apt update' to refresh the package list."
        fi
    ;;
    abort-upgrade|abort-remove|abort-deconfigure)
    ;;
    *)
        echo "postinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac
exit 0
