mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
fix sudoers, add user argument
This commit is contained in:
parent
c989a974b5
commit
a509d339cf
@ -157,9 +157,10 @@ def setup():
|
||||
pass
|
||||
|
||||
@click.command('sudoers')
|
||||
def setup_sudoers():
|
||||
@click.argument('user')
|
||||
def setup_sudoers(user):
|
||||
"Add commands to sudoers list for execution without password"
|
||||
_setup_sudoers()
|
||||
_setup_sudoers(user)
|
||||
|
||||
@click.command('nginx')
|
||||
def setup_nginx():
|
||||
|
@ -122,10 +122,10 @@ def update_bench():
|
||||
cwd = os.path.dirname(os.path.abspath(__file__))
|
||||
exec_cmd("git pull", cwd=cwd)
|
||||
|
||||
def setup_sudoers():
|
||||
def setup_sudoers(user):
|
||||
with open('/etc/sudoers.d/frappe', 'w') as f:
|
||||
f.write("{user} ALL=(ALL) NOPASSWD: {supervisorctl} restart frappe\:\n".format(
|
||||
user=getpass.getuser(),
|
||||
user=user,
|
||||
supervisorctl=subprocess.check_output('which supervisorctl', shell=True).strip()))
|
||||
|
||||
def setup_logging(bench='.'):
|
||||
|
Loading…
Reference in New Issue
Block a user