Fixes in scripts for use native python

This commit is contained in:
absurdo 2023-11-25 19:48:47 +01:00
parent 205ff97ce3
commit def162c1c9
9 changed files with 28 additions and 27 deletions

View file

@ -1,4 +1,4 @@
#!/opt/pythonenv/bin/python3 -u
#!/usr/bin/python3 -u
import sys, os
import subprocess

View file

@ -1,4 +1,4 @@
#!/opt/pythonenv/bin/python3 -u
#!/usr/bin/python3 -u
import sys
import subprocess
@ -160,4 +160,5 @@ if subprocess.call("sudo echo 'mariadb-server mariadb-server/root_password_again
sys.exit(1)
"""
print('Setted the password')
#print('Setted the password')
print('Mariadb installed!')

View file

@ -1,4 +1,4 @@
#!/opt/pythonenv/bin/python3 -u
#!/usr/bin/python3 -u
import sys
import argparse

View file

@ -1,4 +1,4 @@
#!/opt/pythonenv/bin/python3 -u
#!/usr/bin/python3 -u
# A script for install pzoo user

View file

@ -1,4 +1,4 @@
#!/opt/pythonenv/bin/python3 -u
#!/usr/bin/python3 -u
# A script for install pzoo user

View file

@ -20,7 +20,7 @@ elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then
pacman -Syu --noconfirm sudo
sudo pacman -S --noconfirm python python-pip sudo augeas python-virtualenv
sudo pacman -S --noconfirm python python-pip sudo augeas python-virtualenv python-distro
elif [[ $DISTRO =~ ^NAME=\"Rocky ]] || [[ $DISTRO =~ ^Alma ]]; then
@ -28,7 +28,7 @@ elif [[ $DISTRO =~ ^NAME=\"Rocky ]] || [[ $DISTRO =~ ^Alma ]]; then
sudo dnf upgrade -y
sudo dnf install -y python python-pip sudo augeas-libs
sudo dnf install -y python python-pip sudo augeas-libs python3-distro
#Install EPEL
dnf config-manager --set-enabled crb
sudo dnf install -y \
@ -42,7 +42,7 @@ elif [[ $DISTRO =~ ^Fedora ]]; then
sudo dnf upgrade -y
sudo dnf install -y python3 python3-pip sudo augeas-libs
sudo dnf install -y python3 python3-pip sudo augeas-libs python3-distro
else
@ -66,36 +66,36 @@ else
fi
echo '{"error": 0, "status": 0, "progress": 0, "no_progress":0, "message": "Installing distro package for python and detect distribution..."}'
# echo '{"error": 0, "status": 0, "progress": 0, "no_progress":0, "message": "Installing distro package for python and detect distribution..."}'
# Install virtualenv python and give source in profile.
sudo python3 -m venv /opt/pythonenv/
# sudo python3 -m venv /opt/pythonenv/
sudo /opt/pythonenv/bin/pip install --upgrade pip
# sudo /opt/pythonenv/bin/pip install --upgrade pip
#echo "export PS_REAL=\$PS1 && source /opt/pythonenv/bin/activate && export PS1=\$PS_REAL && export PYTHONUNBUFFERED=1" >> /etc/profile.d/zpythonenv.sh
#echo "export PYTHONUNBUFFERED=1" >> /etc/profile.d/pythonenv.sh
sleep 1
# sleep 1
sudo /opt/pythonenv/bin/pip3 install distro
# sudo /opt/pythonenv/bin/pip3 install distro
if [ $? -eq 0 ]; then
# if [ $? -eq 0 ]; then
#echo "Installed python3 sucessfully if not error..."
echo '{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Installed distro python package sucessfully..."}'
#echo '{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Installed distro python package sucessfully..."}'
sleep 1
#sleep 1
else
#else
echo "Sorry, cannot install distro python package..."
# echo "Sorry, cannot install distro python package..."
exit 1;
#exit 1;
fi
#fi
sleep 1

View file

@ -1,4 +1,4 @@
#!/opt/pythonenv/bin/python3 -u
#!/usr/bin/python3 -u
# A script for install pzoo user

View file

@ -1,4 +1,4 @@
#!/opt/pythonenv/bin/python3 -u
#!/usr/bin/python3 -u
# A script for install pzoo user