#!/bin/bash

echo "=========================================="
echo "Installing LiveKit VoiceBot Services"
echo "=========================================="

# Copy systemd service files
echo "Copying systemd service files..."
sudo cp /var/www/html/livekit_frontend/livekit-frontend.service /etc/systemd/system/
sudo cp /var/www/html/livekit_frontend/livekit-backend.service /etc/systemd/system/

# Reload systemd
echo "Reloading systemd daemon..."
sudo systemctl daemon-reload

# Enable services to start on boot
echo "Enabling services..."
sudo systemctl enable livekit-frontend.service
sudo systemctl enable livekit-backend.service

echo ""
echo "Services installed! To start them:"
echo "  sudo systemctl start livekit-frontend"
echo "  sudo systemctl start livekit-backend"
echo ""
echo "To check status:"
echo "  sudo systemctl status livekit-frontend"
echo "  sudo systemctl status livekit-backend"
echo ""
echo "=========================================="
