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

#### meta start
#### project Whonix
#### category tor
#### gateway_only yes
#### description
## Runs <code>/usr/libexec/anon-gw-anonymizer-config/tor-config-sane</code> which runs
## <code>/usr/libexec/helper-scripts/repair-torrc</code> to repair Tor config files.
##
## Qubes-Whonix. Also runs <code>/usr/lib/qubes-whonix/replace-ips</code>.
## Runs <code>Before=tor.service</code>
## and <code>Before=tor@default.service</code>.
#### meta end

[Unit]
Description=Make Sure Torrc Files Exist
Documentation=https://github.com/Whonix/anon-gw-anonymizer-config
ConditionPathExists=!/run/qubes/this-is-templatevm

## Sets up network interface 'eth1'.
After=qubes-whonix-network.service

Before=tor.service
Before=tor@default.service
PartOf=tor.service
PartOf=tor@default.service
ReloadPropagatedFrom=tor.service
ReloadPropagatedFrom=tor@default.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/libexec/anon-gw-anonymizer-config/tor-config-sane

[Install]
WantedBy=multi-user.target
