From 17bd13e580d1a224aa2774f101e56266a80f4553 Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Tue, 2 Apr 2019 03:09:52 +0100 Subject: [PATCH] quote escaping --- home.admin/config.scripts/internet.sshtunnel.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/home.admin/config.scripts/internet.sshtunnel.py b/home.admin/config.scripts/internet.sshtunnel.py index eda5911..dae877c 100755 --- a/home.admin/config.scripts/internet.sshtunnel.py +++ b/home.admin/config.scripts/internet.sshtunnel.py @@ -103,7 +103,7 @@ if sys.argv[1] == "on": print("*** Checking root SSH keys") if Path("/home/root/.ssh/id_rsa.pub").exists() == False: print("Generating root SSH keys ...") - subprocess.call("sudo -u root ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N """, shell=True) + subprocess.call("sudo -u root ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N \"\"", shell=True) print("DONE") else: print("OK - root id_rsa.pub file exists") @@ -140,13 +140,6 @@ if sys.argv[1] == "on": elif sys.argv[1] == "off": - # check if already disabled - try: - subprocess.call("systemctl is-disabled %s" % (SERVICENAME) ,shell=True, universal_newlines=True) - except subprocess.CalledProcessError as e: - print("Was already OFF") - sys.exit(0) - print("*** Disabling systemd service: %s" % (SERVICENAME)) subprocess.call("sudo systemctl stop %s" % (SERVICENAME), shell=True) subprocess.call("sudo systemctl disable %s" % (SERVICENAME), shell=True)