#!/bin/bash

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

canary_config_folders="/etc/systemcheck.d /usr/local/etc/systemcheck.d /usr/local/etc/whonix.d /etc/whonix.d"

if grep -r -q '^whonixcheck_skip_functions+=" download_whonix_news "' $canary_config_folders  2>/dev/null ; then
    true "INFO: Legacy disabled in settings. Doing nothing. Exiting."
    canary_run=false
fi

if grep -r -q '^systemcheck_skip_functions+=" download_whonix_news "' $canary_config_folders 2>/dev/null ; then
    true "INFO: Legacy disabled in settings. Doing nothing. Exiting."
    canary_run=false
fi

if grep -r -q 'canary=false' $canary_config_folders 2>/dev/null ; then
    true "INFO: Disabled in settings. Doing nothing. Exiting."
    canary_run=false
fi
