Files
sfmacro/start-macropad.sh

23 lines
538 B
Bash

#!/bin/bash
# Move to the script's directory
cd "$(dirname "$0")"
echo "Starting Macropad Control Center..."
node server.js &
SERVER_PID=$!
# Wait 2 seconds for server to start
sleep 2
# Open local config page in default browser
if command -v xdg-open > /dev/null; then
xdg-open http://localhost:3001
elif command -v gnome-open > /dev/null; then
gnome-open http://localhost:3001
else
echo "Please open http://localhost:3001 in your browser"
fi
# Keep the script running to allow stopping the server with Ctrl+C
wait $SERVER_PID