Fixes in scripts for fedora derivatives

This commit is contained in:
absurdo 2023-12-01 23:53:14 +01:00
parent 092a4ee969
commit 4dd7e4531f
4 changed files with 16 additions and 14 deletions

View file

@ -52,10 +52,10 @@ if linux_distro=='arch':
php_command='/usr/bin/php-legacy'
if linux_distro=='fedora' or linux_distro=='rocky':
if linux_distro=='fedora' or linux_distro=='rocky' or linux_distro=='almalinux':
php_command='/usr/bin/php'+args.php_version.replace('.', '')
if linux_distro=='debian' or linux_distro=='ubuntu':
php_command='/usr/bin/php'+args.php_version
@ -117,7 +117,7 @@ if os.path.isfile(home_user+'/index.php'):
print('Installing Wordpress...')
if subprocess.call("sudo su %s -s /bin/bash -c '%s %s core download'" % (user, php_command, wp_command), shell=True) > 0:
print('Error')
print("Error: %s %s core download\n" % (php_command, wp_command))
sys.exit(1)
mysql_user=args.user_mysql
@ -128,7 +128,7 @@ host_db=args.server_mysql
if args.port_mysql!=3306:
host_db=host_db+':'+str(args.port_mysql)
if subprocess.call("sudo su %s -s /bin/bash -c '%s %s config create --dbname=%s --dbuser=%s --dbpass=%s --dbhost=%s'" % (user, php_command, wp_command, args.db_mysql, mysql_user, mysql_password, host_db), shell=True) > 0:
if subprocess.call("sudo su %s -s /bin/bash -c '%s %s config create --dbname=%s --dbuser=%s --dbpass=\"%s\" --dbhost=%s'" % (user, php_command, wp_command, args.db_mysql, mysql_user, mysql_password, host_db), shell=True) > 0:
print('Error')
sys.exit(1)
@ -136,7 +136,7 @@ print('Created basic config...')
# Add cronjob for wordpress
if subprocess.call("sudo su %s -s /bin/bash -c '%s %s core install --url=%s --title=\"%s\" --admin_user=%s --admin_password=%s --admin_email=%s'" % (user, php_command, wp_command, args.domain+args.path, args.title, args.user, args.password, args.email), shell=True) > 0:
if subprocess.call("sudo su %s -s /bin/bash -c '%s %s core install --url=%s --title=\"%s\" --admin_user=%s --admin_password=\"%s\" --admin_email=%s'" % (user, php_command, wp_command, args.domain+args.path, args.title, args.user, args.password, args.email), shell=True) > 0:
print('Error: cannot install wordpress')
sys.exit(1)
else: