mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-13 10:30:16 +00:00
16 lines
436 B
Python
16 lines
436 B
Python
import sys
|
|
import subprocess
|
|
import cfg
|
|
|
|
def privilegedaction_run(action, options):
|
|
cmd = ['sudo', '-n', "/usr/share/plinth/actions/%s" % action]
|
|
if options:
|
|
cmd.extend(options)
|
|
cfg.log.info('running: %s ' % ' '.join(cmd))
|
|
|
|
output, error = \
|
|
subprocess.Popen(cmd,
|
|
stdout = subprocess.PIPE,
|
|
stderr= subprocess.PIPE).communicate()
|
|
return output, error
|