Fix in install ssh user
This commit is contained in:
parent
cbf9609a4a
commit
0b57bcab9b
1 changed files with 3 additions and 51 deletions
|
|
@ -112,33 +112,6 @@ if check_url.match(args.url_stats):
|
|||
|
||||
# Create scripts pzoo
|
||||
"""
|
||||
ps=Path('/home/'+args.user+'/pzoo/scripts')
|
||||
|
||||
ps.mkdir(mode=0o755, parents=True, exist_ok=True)
|
||||
|
||||
shutil.chown('/home/'+args.user+'/pzoo', args.user, args.user)
|
||||
|
||||
shutil.chown('/home/'+args.user+'/pzoo/scripts', args.user, args.user)
|
||||
|
||||
|
||||
if call("su - "+args.user+" -s /bin/bash -c \"composer --working-dir=/home/"+args.user+"/pzoo/scripts require guzzlehttp/guzzle:~6.0\"", shell=True)>0:
|
||||
print('Error, cannot install scripts for use in check scripts')
|
||||
exit(1)
|
||||
else:
|
||||
print('Composer dependencies for check scripts added successfully')
|
||||
|
||||
# Edit get_updates.py
|
||||
|
||||
with open('scripts/system/get_updates.py') as f:
|
||||
get_updates=f.read()
|
||||
|
||||
with open('/etc/cron.daily/get_updates.py', 'w') as f:
|
||||
url_updates=args.url.replace('/getinfo/', '/getupdates/')
|
||||
get_updates=get_updates.replace("http://url/to/server/token/ip", url_updates)
|
||||
f.write(get_updates)
|
||||
|
||||
os.chmod('/etc/cron.daily/get_updates.py', 0o700)
|
||||
"""
|
||||
if call("sudo /opt/pythonenv/bin/pip3 install --upgrade git+https://bitbucket.org/paramecio/pastafaristats", shell=True)>0:
|
||||
print('Error, cannot install pastafari stats')
|
||||
exit(1)
|
||||
|
|
@ -158,29 +131,7 @@ if check_url.match(args.url_stats):
|
|||
|
||||
|
||||
with open('/etc/systemd/system/pastafaristats.service', 'w') as f:
|
||||
|
||||
systemd_unit="""
|
||||
# Save it in /etc/systemd/system/pastafaristats.service
|
||||
|
||||
[Unit]
|
||||
Description=Pastafari Stats
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=pzoo
|
||||
Group=pzoo
|
||||
ExecStart=pastafaristats
|
||||
Restart=always
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
"""
|
||||
|
||||
systemd_unit=systemd_unit.replace('pzoo', args.user)
|
||||
|
||||
|
||||
#f.write(systemd_unit)
|
||||
f.write('# Save it in /etc/systemd/system/pastafaristats.service\n')
|
||||
f.write('[Unit]\n')
|
||||
|
|
@ -207,7 +158,8 @@ if check_url.match(args.url_stats):
|
|||
print('Pastafari stats ready')
|
||||
|
||||
print('{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Tools installed..."}')
|
||||
|
||||
"""
|
||||
|
||||
sleep(1)
|
||||
|
||||
linux_distro=distro.id()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue