From 500cfd11e35d4a331a13348e61829d1d88de2dda Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Sat, 18 Oct 2014 08:33:23 -0400 Subject: [PATCH] Add comment to mark end of Plinth Hidden Service configuration block. --- actions/tor | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/actions/tor b/actions/tor index 9f2da6c00..b80662490 100755 --- a/actions/tor +++ b/actions/tor @@ -101,6 +101,7 @@ def subcommand_enable_hs(_): lines.append("HiddenServiceDir /var/lib/tor/hidden_service/\n") lines.append("HiddenServicePort 80 127.0.0.1:80\n") lines.append("HiddenServicePort 443 127.0.0.1:443\n") + lines.append("# end of Plinth Hidden Service config\n") with open(TOR_CONFIG, 'w') as conffile: conffile.writelines(lines) @@ -121,7 +122,11 @@ def subcommand_disable_hs(_): removing = False for line in lines: if removing: - if not line.startswith("HiddenService"): + if line.startswith("# end of Plinth Hidden Service config"): + # last line of Plinth hidden service block + # stop removing after this line + removing = False + elif not line.startswith("HiddenService"): # end of Plinth hidden service block # stop removing lines removing = False