#!/bin/bash

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

## https://github.com/QubesOS/qubes-issues/issues/8398

set -x
set -e

true "$0: START"

## append-once is provided by package: helper-scripts

## XXX: append-once does not support multi-line (with empty lines) yet.

#append-once /etc/tinyproxy/tinyproxy-updates.conf "
## BEGIN: auto-generated configuration by $0

#Upstream socks5 127.0.0.1:9104

## END: auto-generated configuration by $0
#"

append-once /etc/tinyproxy/tinyproxy-updates.conf "## BEGIN: auto-generated configuration by $0"
append-once /etc/tinyproxy/tinyproxy-updates.conf "Upstream socks5 127.0.0.1:9104"
append-once /etc/tinyproxy/tinyproxy-updates.conf "## END: auto-generated configuration by $0"

true "$0: END"
