Adapted for use a python virtualenv

This commit is contained in:
absurdo 2023-07-01 01:06:45 +02:00
parent 711893b7df
commit c5a9654f8b
6 changed files with 12 additions and 7 deletions

View file

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

View file

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

View file

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

View file

@ -14,7 +14,7 @@ if [[ $DISTRO =~ ^Debian ]] || [[ $DISTRO =~ ^Ubuntu ]]; then
sudo apt-get update
apt install sudo
sudo apt-get -y install python3 python3-pip python3-venv libaugeas0
sudo apt-get -y install python3 python3-full python3-pip python3-venv libaugeas0
elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then
@ -74,7 +74,9 @@ 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
#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

View file

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

View file

@ -83,7 +83,7 @@ class ServerTask(Task):
arr_server=serverdb.set_conditions('WHERE ip=%s', [self.server]).select_a_row_where()
if arr_server:
dbserver.insert({'server_id': arr_server['id']})
dbserver.insert({'server_id': arr_server['id'], 'access_ip': self.data['ip']})
return True
@ -122,6 +122,9 @@ class ServerTask(Task):
error=True
if 'access_localhost' in post:
self.data['ip']=''
ip_check=IpField('ip')
ip_host=post['access_localhost'].strip()