diff --git a/main.py b/main.py index b26b647..c75826e 100644 --- a/main.py +++ b/main.py @@ -22,6 +22,6 @@ host = instance.private_ip_address connection = stack.enter_context(SSH(host, 'ec2-user', private_key)) - escaped_command = command.replace('"', '\\"') + escaped_command = command.replace("'", "\\'") print(f'Running command "{escaped_command}" on {host}...') connection.run(f'exec $SHELL -l -c \'{escaped_command}\'')