forked from dsutanto/karung-masuk_frigate-counter
First Commit
This commit is contained in:
32
install.sh
Executable file
32
install.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Install script for Frigate MQTT Counter Service
|
||||
|
||||
echo "Installing Frigate MQTT Counter Service..."
|
||||
|
||||
# Create virtual environment if it doesn't exist
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "Creating virtual environment..."
|
||||
python3 -m venv venv
|
||||
fi
|
||||
|
||||
# Activate virtual environment
|
||||
source venv/bin/activate
|
||||
|
||||
# Install dependencies
|
||||
echo "Installing dependencies..."
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Create database file
|
||||
echo "Creating database..."
|
||||
python -c "import sqlite3; conn = sqlite3.connect('karung_counts.db'); conn.close(); print('Database created successfully')"
|
||||
|
||||
echo "Installation complete!"
|
||||
echo ""
|
||||
echo "To run the service:"
|
||||
echo " source venv/bin/activate"
|
||||
echo " python frigate_counter.py"
|
||||
echo ""
|
||||
echo "To test the service:"
|
||||
echo " source venv/bin/activate"
|
||||
echo " python test_frigate_counter.py"
|
||||
Reference in New Issue
Block a user