mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Bugfix, fix crontab commands on HP-UX
This commit is contained in:
parent
57acf104c6
commit
dbf412b77c
1 changed files with 3 additions and 1 deletions
|
@ -353,6 +353,8 @@ class CronTab(object):
|
|||
if self.user:
|
||||
if platform.system() == 'SunOS':
|
||||
return "su %s -c '%s -l'" % (pipes.quote(self.user), pipes.quote(CRONCMD))
|
||||
elif platform.system() == 'HP-UX':
|
||||
return "%s %s %s" % (CRONCMD , '-l', pipes.quote(self.user))
|
||||
else:
|
||||
user = '-u %s' % pipes.quote(self.user)
|
||||
return "%s %s %s" % (CRONCMD , user, '-l')
|
||||
|
@ -363,7 +365,7 @@ class CronTab(object):
|
|||
"""
|
||||
user = ''
|
||||
if self.user:
|
||||
if platform.system() == 'SunOS':
|
||||
if platform.system() in ['SunOS', 'HP-UX']:
|
||||
return "chown %s %s ; su '%s' -c '%s %s'" % (pipes.quote(self.user), pipes.quote(path), pipes.quote(self.user), CRONCMD, pipes.quote(path))
|
||||
else:
|
||||
user = '-u %s' % pipes.quote(self.user)
|
||||
|
|
Loading…
Reference in a new issue