[v2] update.sh: If 'ExitNode' is in usage, it will be changed to 'ExitNodes'

Message ID 20231201032248.92817-1-erik.kapfer@ipfire.org
State Staged
Commit 7a1683e6cb37f5ad6bbd81b2b54253dd7d253b09
Headers
Series [v2] update.sh: If 'ExitNode' is in usage, it will be changed to 'ExitNodes' |

Commit Message

Erik Kapfer Dec. 1, 2023, 3:22 a.m. UTC
  Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
---
 config/rootfiles/core/182/update.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/config/rootfiles/core/182/update.sh b/config/rootfiles/core/182/update.sh
index 4416e73f4..47a9be230 100644
--- a/config/rootfiles/core/182/update.sh
+++ b/config/rootfiles/core/182/update.sh
@@ -91,6 +91,14 @@  if grep -q "ENABLED=on" /var/ipfire/vpn/settings; then
 	/etc/rc.d/init.d/ipsec start
 fi
 
+# Change deprecated option in tor configuration file if in usage
+if pgrep tor >/dev/null; then
+	sed -i 's/ExitNode /ExitNodes /g' /var/ipfire/tor/torrc
+	/usr/local/bin/torctrl restart >/dev/null
+else
+	sed -i 's/ExitNode /ExitNodes /g' /var/ipfire/tor/torrc
+fi
+
 # Rebuild initial ramdisks
 dracut --regenerate-all --force
 KVER="xxxKVERxxx"