#!/bin/bash

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

## Similar to:
## /usr/libexec/security-misc/pam_only_if_login

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

true "PAM_SERVICE: ${PAM_SERVICE:-}"

if [ "${PAM_SERVICE:-}" = "su" ]; then
   exit 1
else
   exit 0
fi
