From 27d78394f8732088ba63fff5e6526590142b2326 Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Tue, 2 Apr 2019 22:38:26 +0100 Subject: [PATCH] remove empty lines --- home.admin/config.scripts/internet.sshtunnel.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/home.admin/config.scripts/internet.sshtunnel.py b/home.admin/config.scripts/internet.sshtunnel.py index fd693e8..2a94995 100755 --- a/home.admin/config.scripts/internet.sshtunnel.py +++ b/home.admin/config.scripts/internet.sshtunnel.py @@ -140,10 +140,10 @@ if sys.argv[1] == "on": if file_content.count("sshtunnel=") == 0: file_content = file_content+"\nsshtunnel=''" file_content = re.sub("sshtunnel=.*", "sshtunnel='%s %s'" % (ssh_server, ssh_ports), file_content) - file_content = re.sub("\n\n", "\n", file_content) + file_content = "".join([s for s in file_content.splitlines(True) if s.strip("\r\n")]) + "\n" print(file_content) with open("/mnt/hdd/raspiblitz.conf", "w") as text_file: - text_file.write(file_content+"\n") + text_file.write(file_content) print("DONE") # make sure autossh is installed @@ -160,7 +160,9 @@ if sys.argv[1] == "on": # final info (can be ignored if run by other script) print() - print("*** OK - SSH TUNNEL SERVICE DONE SETUP ***") + print("**************************************") + print("*** WIN - SSH TUNNEL SERVICE SETUP ***") + print("**************************************") print("See chapter 'How to setup port-forwarding with a SSH tunnel?' in:") print("https://github.com/rootzoll/raspiblitz/blob/master/FAQ.md") print("- Tunnel service needs final reboot to start.")