#!/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
#### gateway_only yes
#### description
## wrapper to restart Tor
#### meta end

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

cat /etc/motd || true

leaprun restart-tor || true

tor_status_exit_code=0
leaprun tor-status || tor_status_exit_code="$?"

true "${tor_status_exit_code}"

true "Feel free to close this window."

sleep 86400
