-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·147 lines (128 loc) · 4.66 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·147 lines (128 loc) · 4.66 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/bin/bash
# Net Control by K4HEF - Startup Script
# This script helps you quickly set up and start the application
echo "================================================"
echo " Net Control by K4HEF - Setup & Start"
echo "================================================"
echo ""
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed!"
echo "Please install Docker Desktop from: https://www.docker.com/products/docker-desktop/"
exit 1
fi
echo "✅ Docker is installed"
# Check if Docker daemon is running
if ! docker info &> /dev/null; then
echo "❌ Docker daemon is not running!"
echo ""
echo "Please start Docker Desktop and wait for it to fully start."
echo "Look for the Docker whale icon in your menu bar - it should be steady, not animated."
echo ""
echo "Then run this script again."
exit 1
fi
echo "✅ Docker daemon is running"
# Check if Docker Compose is available
if ! command -v docker-compose &> /dev/null && ! docker compose version &> /dev/null; then
echo "❌ Docker Compose is not available!"
echo "Please install Docker Compose or use Docker Desktop which includes it."
exit 1
fi
echo "✅ Docker Compose is available"
echo ""
# Check if .env file exists
if [ ! -f .env ]; then
echo "📝 Creating .env file..."
cat > .env << 'EOF'
JWT_SECRET=NetControl2024SecureKeyForYorkCountyAmateurRadioSociety_ChangeInProduction
EOF
echo "✅ .env file created"
echo "⚠️ Remember to change JWT_SECRET in production!"
else
echo "✅ .env file already exists"
fi
echo ""
# Check if port 80 is in use
if lsof -i :80 &> /dev/null; then
echo "⚠️ WARNING: Port 80 is already in use!"
echo ""
echo "Would you like to use port 8080 instead? (y/n)"
read -r response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo ""
echo "🚀 Starting Net Control on port 8080..."
echo ""
if command -v docker-compose &> /dev/null; then
docker-compose -f docker-compose-port8080.yml up -d
else
docker compose -f docker-compose-port8080.yml up -d
fi
echo ""
echo "================================================"
echo " ✅ Net Control is starting up!"
echo "================================================"
echo ""
echo "The application will be available shortly at:"
echo " 👉 http://localhost:8080 (note the port!)"
echo ""
echo "First time setup:"
echo " 1. Wait 30-60 seconds for services to fully start"
echo " 2. Open http://localhost:8080 in your browser"
echo " 3. Click 'Register' to create your account"
echo " 4. Go to Settings to configure your QRZ API key"
echo ""
echo "Useful commands:"
echo " Stop: docker-compose -f docker-compose-port8080.yml down"
echo " Logs: docker-compose -f docker-compose-port8080.yml logs -f"
echo " Status: docker ps"
echo ""
echo "📻 73 de K4HEF"
echo "================================================"
exit 0
else
echo ""
echo "Please free up port 80 or manually use docker-compose-port8080.yml"
exit 1
fi
fi
echo "🚀 Starting Net Control application..."
echo ""
# Use docker-compose if available, otherwise use docker compose
if command -v docker-compose &> /dev/null; then
docker-compose up -d
else
docker compose up -d
fi
# Wait a moment and check status
sleep 3
echo ""
echo "Checking container status..."
docker ps --format "table {{.Names}}\t{{.Status}}" | grep netcontrol || echo "No containers running yet, they may still be starting..."
echo ""
echo "================================================"
echo " ✅ Net Control is starting up!"
echo "================================================"
echo ""
echo "The application will be available shortly at:"
echo " 👉 http://localhost"
echo ""
echo "First time setup:"
echo " 1. Wait 30-60 seconds for services to fully start"
echo " 2. Open http://localhost in your browser"
echo " 3. Click 'Register' to create your account"
echo " 4. Go to Settings to configure your QRZ API key"
echo ""
echo "If you get 'Can't connect to server':"
echo " - Wait a full minute (first start takes time)"
echo " - Check logs: docker-compose logs -f"
echo " - See QUICK_FIX.md for troubleshooting"
echo ""
echo "Useful commands:"
echo " Stop: docker-compose down"
echo " Logs: docker-compose logs -f"
echo " Status: docker ps"
echo " Rebuild: docker-compose up -d --build"
echo ""
echo "📻 73 de K4HEF"
echo "================================================"