fixed problem with running scripts and ssh key generation on new lxc
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mathieu Broillet 2023-06-19 09:58:29 +02:00
parent 9fe806882e
commit 673c7a3858
No known key found for this signature in database
GPG Key ID: 7D4F25BC50A0AA32
2 changed files with 4 additions and 1 deletions

View File

@ -61,3 +61,6 @@ fi
# Set PermitRootLogin to prohibit-password
sed -i 's/^#*PermitRootLogin.*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config
# Generate SSH keys (doesn't overwrite if keys already exists)
ssh-keygen -q -t rsa -N '' <<< $'\nn' >/dev/null 2>&1

View File

@ -362,7 +362,7 @@ class LXC(LinuxMachine):
:param script_path:
:return:
"""
return self.run_command(command=f"chmod +x {script_path} && bash {script_path}")
return self.run_command(command=f"bash {script_path}")
def run_command(self, command: str, return_status_code: bool = False,
exception_on_exit: bool = False,