#!/bin/bash

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

#set -x
set -e

## NOTE: Running "bash -x systemcheck" might be a bad idea as it disables AppArmor.
##       Better options:
##       - Use 'SHELLOPTS=xtrace'
#SHELLOPTS=xtrace systemcheck
##       - Use '--debug' option.
#          systemcheck --debug

#safe-rm -f -- /tmp/systemcheck-debug.txt
#exec 5>&1 1>> /tmp/systemcheck-debug.txt
#exec 6>&2 2>> /tmp/systemcheck-debug.txt

#source /usr/libexec/helper-scripts/lockfile.sh

if [ -o xtrace ]; then
  ## XXX: Might add a superfluous ':xtrace'.
  env SHELLOPTS=xtrace /usr/libexec/systemcheck/systemcheck "$@"
else
  /usr/libexec/systemcheck/systemcheck "$@"
fi
