fix: Conditionally compile systemd features for Linux only

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
Chaos Rogers 2025-07-21 19:46:16 +01:00
parent b854d29015
commit 12065a08c2
4 changed files with 52 additions and 20 deletions

View file

@ -28,11 +28,15 @@ sudo ln -sf $INSTALL_DIR/timeturner $BIN_DIR/timeturner
echo "✅ Binary installed to $INSTALL_DIR and linked to $BIN_DIR."
# 4. Install systemd service file
echo "⚙️ Installing systemd service..."
sudo cp timeturner.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable timeturner.service
echo "✅ Systemd service installed and enabled."
if [[ "$(uname)" == "Linux" ]]; then
echo "⚙️ Installing systemd service for Linux..."
sudo cp timeturner.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable timeturner.service
echo "✅ Systemd service installed and enabled."
else
echo "⚠️ Skipping systemd service installation on non-Linux OS."
fi
echo ""
echo "--- Setup Complete ---"
@ -40,12 +44,14 @@ echo "The TimeTurner daemon is now installed."
echo "The working directory is $INSTALL_DIR."
echo "A default 'config.yml' will be created there on first run."
echo ""
echo "To start the service, run:"
echo " sudo systemctl start timeturner.service"
echo ""
echo "To view live logs, run:"
echo " journalctl -u timeturner.service -f"
echo ""
if [[ "$(uname)" == "Linux" ]]; then
echo "To start the service, run:"
echo " sudo systemctl start timeturner.service"
echo ""
echo "To view live logs, run:"
echo " journalctl -u timeturner.service -f"
echo ""
fi
echo "To run the interactive TUI instead, simply run from the project directory:"
echo " cargo run"
echo "Or from anywhere after installation:"