-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatus.sh
More file actions
executable file
·64 lines (52 loc) · 1.54 KB
/
status.sh
File metadata and controls
executable file
·64 lines (52 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# TaskPulse Status Script
# Shows the status of both servers
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
BACKEND_URL="http://localhost:3000"
FRONTEND_URL="http://localhost:3050"
echo -e "${BLUE}======================================${NC}"
echo -e "${BLUE}TaskPulse Server Status${NC}"
echo -e "${BLUE}======================================${NC}\n"
# Check backend
echo -n "Backend (port 3000): "
if curl -s "${BACKEND_URL}/health" > /dev/null 2>&1; then
echo -e "${GREEN}✓ RUNNING${NC}"
echo -e " Health: ${GREEN}OK${NC}"
echo " URL: ${BACKEND_URL}"
echo " API: ${BACKEND_URL}/api"
else
echo -e "${RED}✗ NOT RUNNING${NC}"
echo " Unable to connect to ${BACKEND_URL}"
fi
echo ""
# Check frontend
echo -n "Frontend (port 3050): "
if curl -s "${FRONTEND_URL}" > /dev/null 2>&1; then
echo -e "${GREEN}✓ RUNNING${NC}"
echo -e " Health: ${GREEN}OK${NC}"
echo " URL: ${FRONTEND_URL}"
else
echo -e "${RED}✗ NOT RUNNING${NC}"
echo " Unable to connect to ${FRONTEND_URL}"
fi
echo ""
# Check if processes are running
echo "Process Status:"
BACKEND_PID=$(lsof -ti:3000 2>/dev/null || true)
FRONTEND_PID=$(lsof -ti:3050 2>/dev/null || true)
if [ -n "$BACKEND_PID" ]; then
echo -e " Backend PID: ${GREEN}$BACKEND_PID${NC}"
else
echo -e " Backend PID: ${RED}Not found${NC}"
fi
if [ -n "$FRONTEND_PID" ]; then
echo -e " Frontend PID: ${GREEN}$FRONTEND_PID${NC}"
else
echo -e " Frontend PID: ${RED}Not found${NC}"
fi
echo ""