#!/bin/bash
# Installation script for HVAC Content Aggregation systemd services

echo "Installing HVAC Content Aggregation systemd services..."

# Copy service files
sudo cp hvac-content-8am.service /etc/systemd/system/
sudo cp hvac-content-8am.timer /etc/systemd/system/
sudo cp hvac-content-12pm.service /etc/systemd/system/
sudo cp hvac-content-12pm.timer /etc/systemd/system/

# Reload systemd
sudo systemctl daemon-reload

# Enable timers
sudo systemctl enable hvac-content-8am.timer
sudo systemctl enable hvac-content-12pm.timer

# Start timers
sudo systemctl start hvac-content-8am.timer
sudo systemctl start hvac-content-12pm.timer

# Show status
echo ""
echo "Service status:"
sudo systemctl status hvac-content-8am.timer --no-pager
echo ""
sudo systemctl status hvac-content-12pm.timer --no-pager

echo ""
echo "Installation complete!"
echo ""
echo "Useful commands:"
echo "  View logs: journalctl -u hvac-content-8am -f"
echo "  Check timer: systemctl list-timers | grep hvac"
echo "  Manual run: sudo systemctl start hvac-content-8am.service"