BUGFIX : dont insert sudo if already there (was having duplicates at 2nd run)

This commit is contained in:
yo 2020-12-24 16:51:03 +01:00
parent 9966b7653c
commit f8fc953530

View File

@ -83,7 +83,8 @@ class QueueControl(object):
:ref:`pymailq-configuration` :ref:`pymailq-configuration`
""" """
cmd = CONFIG['commands'][operation + '_message'] cmd = CONFIG['commands'][operation + '_message']
if CONFIG['commands']['use_sudo']: # Dont duplicate sudo
if CONFIG['commands']['use_sudo'] and cmd[0] != 'sudo':
cmd.insert(0, 'sudo') cmd.insert(0, 'sudo')
return cmd return cmd