-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·51 lines (43 loc) · 1.31 KB
/
start.sh
File metadata and controls
executable file
·51 lines (43 loc) · 1.31 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
#!/bin/bash
# =========================
# rscp2mqtt Compose Wrapper
# =========================
# Default values
USE_BROKER=false
USE_DASHBOARD=false
COMPOSE_FILE="docker-compose.yml"
# Help message
print_help() {
echo "Usage: $0 [OPTIONS]"
echo ""
echo "Options:"
echo " --with-broker Start internal MQTT broker"
echo " --with-dashboard Start rscp2mqtt-dashboard"
echo " --help Show this help message"
echo ""
echo "Examples:"
echo " $0 # rscp2mqtt only"
echo " $0 --with-dashboard # rscp2mqtt + dashboard"
echo " $0 --with-broker # rscp2mqtt + internal broker"
echo " $0 --with-dashboard --with-broker # all services"
}
# Parse arguments
while [[ "$#" -gt 0 ]]; do
case "$1" in
--with-broker) USE_BROKER=true ;;
--with-dashboard) USE_DASHBOARD=true ;;
--help) print_help; exit 0 ;;
*) echo "Unknown option: $1"; print_help; exit 1 ;;
esac
shift
done
# Build profile args
PROFILES=()
$USE_BROKER && PROFILES+=("--profile" "internal-broker")
$USE_DASHBOARD && PROFILES+=("--profile" "dashboard")
# Compose up with optional profiles
echo "🚀 Starting Docker Compose with:"
echo " - internal-broker: $USE_BROKER"
echo " - dashboard: $USE_DASHBOARD"
echo ""
docker compose -f "$COMPOSE_FILE" "${PROFILES[@]}" up -d