From 7a992500f78ed04695b7d0cbaf76b01dda045270 Mon Sep 17 00:00:00 2001 From: Alessio Caiazza Date: Thu, 10 Sep 2020 13:53:21 +0200 Subject: [PATCH] Do not edit tor systemd script (#1506) * Do not edit tor systemd script Systemd unit files under `/lib` should not be edited. This commit will make use of `/etc/systemd/system/tor@default.service.d/` instead * Update internet.tor.sh Suppress output of `tee`. * Update internet.tor.sh avoid duplicate lines Co-authored-by: frennkie --- home.admin/config.scripts/internet.tor.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/home.admin/config.scripts/internet.tor.sh b/home.admin/config.scripts/internet.tor.sh index bc0607965..c37c2612f 100755 --- a/home.admin/config.scripts/internet.tor.sh +++ b/home.admin/config.scripts/internet.tor.sh @@ -341,7 +341,10 @@ EOF sudo chown -R bitcoin:bitcoin /var/run/tor/ 2>/dev/null echo "" - echo "ReadWriteDirectories=-/mnt/hdd/tor" | sudo tee -a /lib/systemd/system/tor@default.service + sudo mkdir -p /etc/systemd/system/tor@default.service.d + if ! grep -Eq "^ReadWriteDirectories=" /etc/systemd/system/tor@default.service.d/raspiblitz.conf; then + echo -e "[Service]\nReadWriteDirectories=-/mnt/hdd/tor" | sudo tee -a /etc/systemd/system/tor@default.service.d/raspiblitz.conf >/dev/null + fi else echo "TOR package/service is installed and was prepared earlier .. just activating again"