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)

View file

@ -0,0 +1,18 @@
#!/usr/bin/python3 -u
# A script for install pzoo user
import subprocess
import argparse
import re
import os
import shutil
import pwd
from subprocess import call
from pathlib import Path
from time import sleep
import distro
if call("sudo useradd -m -s /bin/bash %s" % args.user, shell=True) > 0:
print('Error, cannot install psutil...')
exit(1)

View file

@ -13,15 +13,15 @@ DISTRO=`( lsb_release -ds || cat /etc/*release || uname -om ) 2>/dev/null | head
if [[ $DISTRO =~ ^Debian ]] || [[ $DISTRO =~ ^Ubuntu ]]; then
sudo apt-get update
sudo apt-get -y install python3 python3-pip
sudo apt-get -y install python3 python3-pip sudo
elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then
sudo pacman -Syu --noconfirm python python-pip
sudo pacman -Syu --noconfirm python python-pip sudo
elif [[ $DISTRO =~ ^NAME=\"Rocky ]]; then
sudo dnf install -y python python-pip
sudo dnf install -y python python-pip sudo
#Install EPEL
dnf config-manager --set-enabled crb
sudo dnf install -y \
@ -33,7 +33,7 @@ elif [[ $DISTRO =~ ^Fedora ]]; then
sudo dnf upgrade -y
sudo dnf install -y python3 python3-pip
sudo dnf install -y python3 python3-pip sudo
else

View file

@ -0,0 +1,6 @@
#!/bin/sh
# Install unix tools repo.
sudo pip3 install git+https://bitbucket.org/paramecio/pastafariutils