Fixes in scripts

This commit is contained in:
absurdo 2023-03-28 18:20:35 +02:00
parent 3a665b3d81
commit cf07859027
7 changed files with 67 additions and 4 deletions

View file

@ -0,0 +1,29 @@
#!/usr/bin/python3 -u
# A script for install pzoo user
from subprocess import call
from time import sleep
import distro
linux_distro=distro.id()
print('{"error": 0, "status": 0, "progress": 0, "no_progress":0, "message": "Installing php..."}')
sleep(1)
if linux_distro=='arch':
if call("sudo pacman -S --noconfirm php php-gd php-pgsql php-snmp php-sodium php-sqlite", shell=True) > 0:
print('Error, cannot install php...')
exit(1)
elif linux_distro=='debian' or linux_distro=='ubuntu':
if call('sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y php-fpm php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip php-redis unzip', shell=True) > 0:
print('Error, cannot install php...')
exit(1)
elif linux_distro=='rocky' or linux_distro=='fedora':
if call("sudo dnf install -y php php-gd php-mysqlnd php-fpm php-zip", shell=True) > 0:
print('Error, cannot install php...')
exit(1)