Commit 241f3298 authored by Tails developers's avatar Tails developers

Add shell library functions for modifying torrc.

parent e654c92c
......@@ -46,3 +46,15 @@ tor_bootstrap_progress() {
tor_is_working() {
[ -e $TOR_DESCRIPTORS ] || [ -e $NEW_TOR_DESCRIPTORS ]
}
tor_append_to_torrc () {
echo "${@}" >> "${TOR_RC}"
}
# Set a (possibly existing) option $1 to $2 in torrc. Shouldn't be
# used for options that can be set multiple times (e.g. the listener
# options).
tor_set_in_torrc () {
sed -i "/^${1}\s/d" "${TOR_RC}"
tor_append_to_torrc "${1} ${2}"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment