Fixes in scripts for use native python
This commit is contained in:
parent
205ff97ce3
commit
def162c1c9
9 changed files with 28 additions and 27 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#!/opt/pythonenv/bin/python3 -u
|
||||
#!/usr/bin/python3 -u
|
||||
|
||||
import sys, os
|
||||
import subprocess
|
||||
|
|
|
|||
|
|
@ -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!')
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/opt/pythonenv/bin/python3 -u
|
||||
#!/usr/bin/python3 -u
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/opt/pythonenv/bin/python3 -u
|
||||
#!/usr/bin/python3 -u
|
||||
|
||||
# A script for install pzoo user
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/opt/pythonenv/bin/python3 -u
|
||||
#!/usr/bin/python3 -u
|
||||
|
||||
# A script for install pzoo user
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/opt/pythonenv/bin/python3 -u
|
||||
#!/usr/bin/python3 -u
|
||||
|
||||
# A script for install pzoo user
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/opt/pythonenv/bin/python3 -u
|
||||
#!/usr/bin/python3 -u
|
||||
|
||||
# A script for install pzoo user
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ class ServerTask(Task):
|
|||
|
||||
self.files=[['modules/pastafari2/scripts/system/install_pzoo_stats.py', 0o755]]
|
||||
self.files.append(['modules/pastafari2/scripts/system/install_python.sh', 0o755])
|
||||
self.files.append(['modules/pastafari2/scripts/system/install_psutil.sh', 0o755])
|
||||
#self.files.append(['modules/pastafari2/scripts/system/install_psutil.sh', 0o755])
|
||||
self.files.append(['modules/pastafari2/scripts/system/install_git.py', 0o755])
|
||||
self.files.append(['modules/pastafari2/scripts/system/install_php.py', 0o755])
|
||||
self.files.append(['modules/pastafari2/scripts/system/install_unixutils.sh', 0o755])
|
||||
#self.files.append(['modules/pastafari2/scripts/system/install_unixutils.sh', 0o755])
|
||||
self.files.append(['modules/pastafari2/scripts/system/sudoers.d/spanel', 0o640])
|
||||
|
||||
self.files.append([self.data['pub_key'], 0o600])
|
||||
|
|
@ -25,8 +25,8 @@ class ServerTask(Task):
|
|||
self.commands_to_execute.append(['modules/pastafari2/scripts/system/install_python.sh', ''])
|
||||
self.commands_to_execute.append(['modules/pastafari2/scripts/system/install_git.py', ''])
|
||||
self.commands_to_execute.append(['modules/pastafari2/scripts/system/install_php.py', ''])
|
||||
self.commands_to_execute.append(['modules/pastafari2/scripts/system/install_unixutils.sh', ''])
|
||||
self.commands_to_execute.append(['modules/pastafari2/scripts/system/install_psutil.sh', ''])
|
||||
#self.commands_to_execute.append(['modules/pastafari2/scripts/system/install_unixutils.sh', ''])
|
||||
#self.commands_to_execute.append(['modules/pastafari2/scripts/system/install_psutil.sh', ''])
|
||||
|
||||
#' --url_stats='+self.data['url_stats']+
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue