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
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[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
|
WorkingDirectory=/etc/hysteria/core/scripts/singbox
|
||||||
EnvironmentFile=/etc/hysteria/core/scripts/singbox/.env
|
EnvironmentFile=/etc/hysteria/core/scripts/singbox/.env
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|||||||
@ -19,7 +19,7 @@ Description=Hysteria Telegram Bot
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[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
|
WorkingDirectory=/etc/hysteria/core/scripts/telegrambot
|
||||||
Restart=always
|
Restart=always
|
||||||
User=root
|
User=root
|
||||||
|
|||||||
@ -22,8 +22,8 @@ source /etc/hysteria/hysteria2_venv/bin/activate
|
|||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
|
||||||
# Add alias 'hys2' for Hysteria2
|
# Add alias 'hys2' for Hysteria2
|
||||||
if ! grep -q "alias hys2='/etc/hysteria/menu.sh'" ~/.bashrc; then
|
if ! grep -q "alias hys2='source /etc/hysteria/hysteria2_venv/bin/activate && /etc/hysteria/menu.sh'" ~/.bashrc; then
|
||||||
echo "alias hys2='/etc/hysteria/menu.sh'" >> ~/.bashrc
|
echo "alias hys2='source /etc/hysteria/hysteria2_venv/bin/activate && /etc/hysteria/menu.sh'" >> ~/.bashrc
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user