Adapted for use a python virtualenv
This commit is contained in:
parent
711893b7df
commit
c5a9654f8b
6 changed files with 12 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python3
|
#!/opt/pythonenv/bin/python3 -u
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/python3 -u
|
#!/opt/pythonenv/bin/python3 -u
|
||||||
|
|
||||||
# A script for install pzoo user
|
# A script for install pzoo user
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/python3 -u
|
#!/opt/pythonenv/bin/python3 -u
|
||||||
|
|
||||||
# A script for install pzoo user
|
# A script for install pzoo user
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ if [[ $DISTRO =~ ^Debian ]] || [[ $DISTRO =~ ^Ubuntu ]]; then
|
||||||
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
apt install sudo
|
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
|
elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then
|
||||||
|
|
||||||
|
|
@ -74,7 +74,9 @@ 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" >> /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
|
sleep 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/python3 -u
|
#!/opt/pythonenv/bin/python3 -u
|
||||||
|
|
||||||
# A script for install pzoo user
|
# A script for install pzoo user
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ class ServerTask(Task):
|
||||||
arr_server=serverdb.set_conditions('WHERE ip=%s', [self.server]).select_a_row_where()
|
arr_server=serverdb.set_conditions('WHERE ip=%s', [self.server]).select_a_row_where()
|
||||||
|
|
||||||
if arr_server:
|
if arr_server:
|
||||||
dbserver.insert({'server_id': arr_server['id']})
|
dbserver.insert({'server_id': arr_server['id'], 'access_ip': self.data['ip']})
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
@ -122,6 +122,9 @@ class ServerTask(Task):
|
||||||
error=True
|
error=True
|
||||||
|
|
||||||
if 'access_localhost' in post:
|
if 'access_localhost' in post:
|
||||||
|
|
||||||
|
self.data['ip']=''
|
||||||
|
|
||||||
ip_check=IpField('ip')
|
ip_check=IpField('ip')
|
||||||
|
|
||||||
ip_host=post['access_localhost'].strip()
|
ip_host=post['access_localhost'].strip()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue