#!/bin/bash

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

#### meta start
#### project Whonix
#### category tor and usability
#### description
#### gateway_only yes
## Deletes Tor consensus files.
#### meta end

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

if ! [ "$(id -u)" = 0 ]; then
   printf '%s\n' "$0: ERROR: This script must run as root/sudo! run:"
   printf '%s\n' "sudo $0"
   exit 1
fi

safe-rm -f -- /var/lib/tor/cached-certs
safe-rm -f -- /var/lib/tor/cached-microdesc-consensus
safe-rm -f -- /var/lib/tor/cached-microdescs
safe-rm -f -- /var/lib/tor/cached-microdescs.new
