Fixes in scripts for debian 12

This commit is contained in:
absurdo 2023-06-23 01:12:01 +02:00
parent 9161c35cac
commit 711893b7df
4 changed files with 15 additions and 7 deletions

View file

@ -6,7 +6,7 @@ sleep 1
echo '{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Installing python3-psutil..."}' echo '{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Installing python3-psutil..."}'
sudo pip3 install psutil sudo /opt/pythonenv/bin/pip3 install psutil
#sudo apt-get install -y python3-psutil #sudo apt-get install -y python3-psutil
#echo "Installed python3-psutil sucessfully if not error..." #echo "Installed python3-psutil sucessfully if not error..."

View file

@ -22,7 +22,7 @@ elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then
sudo pacman -S --noconfirm python python-pip sudo augeas python-virtualenv sudo pacman -S --noconfirm python python-pip sudo augeas python-virtualenv
elif [[ $DISTRO =~ ^NAME=\"Rocky ]]; then elif [[ $DISTRO =~ ^NAME=\"Rocky ]] || [[ $DISTRO =~ ^NAME=\"Alma ]]; then
dnf install -y sudo dnf install -y sudo
@ -68,9 +68,17 @@ 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 /opt/pythonenv/bin/pip install --upgrade pip
echo "export PS_REAL=\$PS1 && source /opt/pythonenv/bin/activate && export PS1=\$PS_REAL" >> /etc/profile.d/zpythonenv.sh
sleep 1 sleep 1
sudo pip3 install distro sudo /opt/pythonenv/bin/pip3 install distro
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then

View file

@ -139,7 +139,7 @@ if check_url.match(args.url_stats):
os.chmod('/etc/cron.daily/get_updates.py', 0o700) os.chmod('/etc/cron.daily/get_updates.py', 0o700)
""" """
if call("sudo pip3 install --upgrade git+https://bitbucket.org/paramecio/pastafaristats", shell=True)>0: if call("sudo /opt/pythonenv/bin/pip3 install --upgrade git+https://bitbucket.org/paramecio/pastafaristats", shell=True)>0:
print('Error, cannot install pastafari stats') print('Error, cannot install pastafari stats')
exit(1) exit(1)
else: else:

View file

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