Fixed a typo and hopefully prevented sudo issues with shell=True

This commit is contained in:
Erik Thuning 2025-02-27 15:29:25 +01:00
parent 9b925faec3
commit 59ae5f96a5

@ -103,8 +103,9 @@ def run_wg(*args, input: str=None):
def run_command(command, *args) -> None:
# The command must be called on an absolute path so that it's possible
# to set up a safe sudoers rule for it.
command_path = Path().join('commands.sh')
subprocess.run(['sudo', command_path.absolute(), command, *args])
command_path = Path().joinpath('commands.sh')
subprocess.run(['sudo', command_path.absolute(), command, *args],
shell=True)
def create_route(client_ip: ipaddress) -> None:
run_command('add', f'{client_ip}/32')