#!/bin/bash # ComposeSync Installation Test Script # Run this after installation to verify everything works set -e # Get the installation directory from the service file INSTALL_DIR="" if systemctl list-unit-files | grep -q composesync; then INSTALL_DIR=$(systemctl show composesync --property=ExecStart 2>/dev/null | sed 's/.*ExecStart=//' | sed 's|/update-agent.sh.*||' || echo "") fi # If we can't get it from the service, try to determine from current directory if [ -z "$INSTALL_DIR" ]; then # Check if we're in a ComposeSync installation directory if [ -f "update-agent.sh" ] && [ -f "config-parser.sh" ]; then INSTALL_DIR="$(pwd)" echo "โš ๏ธ Service not found, testing current directory: $INSTALL_DIR" else echo "โŒ Could not determine installation directory from service or current location" echo " Make sure you're running this from the ComposeSync installation directory" exit 1 fi fi echo "๐Ÿงช Testing ComposeSync installation in: $INSTALL_DIR" # Check if service exists if ! systemctl list-unit-files | grep -q composesync; then echo "โŒ ComposeSync service not found" exit 1 fi # Check if service is enabled if systemctl is-enabled --quiet composesync; then echo "โœ… Service is enabled" else echo "โŒ Service is not enabled" fi # Check if service is running if systemctl is-active --quiet composesync; then echo "โœ… Service is running" else echo "โŒ Service is not running" fi # Check if files exist if [ -f "$INSTALL_DIR/update-agent.sh" ]; then echo "โœ… update-agent.sh exists" else echo "โŒ update-agent.sh missing" fi if [ -f "$INSTALL_DIR/config-parser.sh" ]; then echo "โœ… config-parser.sh exists" else echo "โŒ config-parser.sh missing" fi if [ -f "$INSTALL_DIR/.env" ]; then echo "โœ… .env file exists" else echo "โŒ .env file missing" fi # Check permissions if [ -x "$INSTALL_DIR/update-agent.sh" ]; then echo "โœ… update-agent.sh is executable" else echo "โŒ update-agent.sh is not executable" fi # Check recent logs echo "" echo "๐Ÿ“‹ Recent service logs:" journalctl -u composesync --no-pager -n 10 echo "" echo "๐ŸŽ‰ Installation test complete!" echo "" echo "If you see any โŒ errors above, please check the troubleshooting guide:" echo " https://github.com/your-repo/ComposeSync/blob/main/Docs/troubleshooting.md"