Fixes in mariadb module

This commit is contained in:
Antonio de la Rosa 2024-02-15 22:31:08 +01:00
parent ff81d2aa8d
commit 1a20fdd944
3 changed files with 8 additions and 5 deletions

View file

@ -1,4 +1,4 @@
#!/opt/pythonenv/bin/python3 -u
#!/usr/bin/python3 -u
# A script for install pzoo user
@ -13,7 +13,7 @@ from pathlib import Path
from time import sleep
import distro
parser = argparse.ArgumentParser(description='A script for install leviathan user')
parser = argparse.ArgumentParser(description='A script for install pastafaristats stats')
#parser.add_argument('--url', help='The url where notify updates', required=True)
parser.add_argument('--url_stats', help='The url where pastafaristats notify the stats', required=True)
@ -40,7 +40,7 @@ if check_url.match(args.url_stats):
# Create scripts pzoo
if call("sudo /opt/pythonenv/bin/pip3 install --upgrade git+https://bitbucket.org/paramecio/pastafaristats", shell=True)>0:
if call("sudo /home/{}/pythonenv/bin/pip3 install --upgrade git+https://bitbucket.org/paramecio/pastafaristats".format(args.user), shell=True)>0:
print('Error, cannot install pastafari stats')
exit(1)
else:
@ -71,7 +71,7 @@ if check_url.match(args.url_stats):
f.write('Type=simple\n')
f.write('User=pzoo\n'.replace('pzoo', args.user))
f.write('Group=pzoo\n'.replace('pzoo', args.user))
f.write('ExecStart=/opt/pythonenv/bin/pastafaristats\n')
f.write('ExecStart=/home/{}/pythonenv/bin/pastafaristats\n'.format(args.user))
f.write('Restart=always\n')
f.write('Environment=PYTHONUNBUFFERED=1\n\n')