mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-03-29 03:19:51 +00:00
Update installer and service for venv
This commit is contained in:
@@ -91,14 +91,17 @@ echo -e "${YELLOW}Step 6: Enabling service${NC}"
|
||||
systemctl enable "$SERVICE_NAME"
|
||||
echo -e "${GREEN}Enabled $SERVICE_NAME service${NC}"
|
||||
|
||||
echo -e "${YELLOW}Step 7: Installing Python dependencies${NC}"
|
||||
# Install Python dependencies
|
||||
if command -v pip3 &> /dev/null; then
|
||||
pip3 install -r "$INSTALL_DIR/requirements.txt"
|
||||
echo -e "${GREEN}Installed Python dependencies${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}pip3 not found, please install dependencies manually${NC}"
|
||||
fi
|
||||
echo -e "${YELLOW}Step 7: Installing Python dependencies in virtual environment${NC}"
|
||||
# Create virtual environment
|
||||
python3 -m venv "$INSTALL_DIR/venv"
|
||||
echo -e "${GREEN}Created virtual environment${NC}"
|
||||
|
||||
# Install dependencies in venv
|
||||
"$INSTALL_DIR/venv/bin/pip" install -r "$INSTALL_DIR/requirements.txt"
|
||||
echo -e "${GREEN}Installed Python dependencies${NC}"
|
||||
|
||||
# Update ownership of venv
|
||||
chown -R "$SERVICE_USER:$SERVICE_GROUP" "$INSTALL_DIR/venv"
|
||||
|
||||
echo ""
|
||||
echo -e "${GREEN}Installation completed successfully!${NC}"
|
||||
|
||||
@@ -9,7 +9,7 @@ Type=simple
|
||||
User=meshcore
|
||||
Group=meshcore
|
||||
WorkingDirectory=/opt/meshcore-bot
|
||||
ExecStart=/usr/bin/python3 /opt/meshcore-bot/meshcore_bot.py
|
||||
ExecStart=/opt/meshcore-bot/venv/bin/python /opt/meshcore-bot/meshcore_bot.py
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
Reference in New Issue
Block a user