Added support for php, composer, and php utilities
This commit is contained in:
parent
def162c1c9
commit
929a13eb88
5 changed files with 91 additions and 5 deletions
36
scripts/system/install_leviathanutils.py
Normal file
36
scripts/system/install_leviathanutils.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/python3 -u
|
||||
|
||||
import sys, os
|
||||
import subprocess
|
||||
import argparse
|
||||
import platform
|
||||
import shutil
|
||||
import pathlib
|
||||
import distro
|
||||
import pwd
|
||||
import getpass
|
||||
import re
|
||||
import platform
|
||||
|
||||
#import pymysql.cursors
|
||||
#pymysql.install_as_MySQLdb
|
||||
|
||||
pyv=platform.python_version_tuple()
|
||||
|
||||
if pyv[0]!='3':
|
||||
print('Need python 3 for execute this script')
|
||||
sys.exit(1)
|
||||
|
||||
parser=argparse.ArgumentParser(prog='install_leviathanutils.py', description='Add leviathanutils for a system user')
|
||||
|
||||
parser.add_argument('--user', help='The user used for install leviathanutils', required=True)
|
||||
|
||||
args=parser.parse_args()
|
||||
|
||||
user=args.user
|
||||
|
||||
if subprocess.call("cd /home/{} && git clone https://git.cuchulu.com/phangoapp/leviathanutils.git && COMPOSER_ALLOW_SUPERUSER=1 composer install --working-dir=/home/{}/leviathanutils && chown -R {}:{} /home/{}/leviathanutils".format(user, user, user, user, user), shell=True) > 0:
|
||||
print('Error, cannot install leviathanutils...')
|
||||
exit(1)
|
||||
|
||||
print("Leviathanutils installed...")
|
||||
Loading…
Add table
Add a link
Reference in a new issue