Fix virtual environment
* Fix virtual environment * Support os ubuntu 20+ - debian 11+
This commit is contained in:
@ -32,7 +32,7 @@ Description=Singbox Python Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/etc/hysteria/hysteria2_venv/bin/python /etc/hysteria/core/scripts/singbox/singbox.py
|
||||
ExecStart=/bin/bash -c 'source /etc/hysteria/hysteria2_venv/bin/activate && /etc/hysteria/hysteria2_venv/bin/python /etc/hysteria/core/scripts/singbox/singbox.py'
|
||||
WorkingDirectory=/etc/hysteria/core/scripts/singbox
|
||||
EnvironmentFile=/etc/hysteria/core/scripts/singbox/.env
|
||||
Restart=always
|
||||
|
||||
@ -19,7 +19,7 @@ Description=Hysteria Telegram Bot
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/etc/hysteria/hysteria2_venv/bin/python /etc/hysteria/core/scripts/telegrambot/tbot.py
|
||||
ExecStart=/bin/bash -c 'source /etc/hysteria/hysteria2_venv/bin/activate && /etc/hysteria/hysteria2_venv/bin/python /etc/hysteria/core/scripts/telegrambot/tbot.py'
|
||||
WorkingDirectory=/etc/hysteria/core/scripts/telegrambot
|
||||
Restart=always
|
||||
User=root
|
||||
|
||||
@ -22,8 +22,8 @@ source /etc/hysteria/hysteria2_venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Add alias 'hys2' for Hysteria2
|
||||
if ! grep -q "alias hys2='/etc/hysteria/menu.sh'" ~/.bashrc; then
|
||||
echo "alias hys2='/etc/hysteria/menu.sh'" >> ~/.bashrc
|
||||
if ! grep -q "alias hys2='source /etc/hysteria/hysteria2_venv/bin/activate && /etc/hysteria/menu.sh'" ~/.bashrc; then
|
||||
echo "alias hys2='source /etc/hysteria/hysteria2_venv/bin/activate && /etc/hysteria/menu.sh'" >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user