-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery.sh
More file actions
executable file
·124 lines (117 loc) · 4.1 KB
/
query.sh
File metadata and controls
executable file
·124 lines (117 loc) · 4.1 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
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
BOLD='\033[1m'
NC='\033[0m' # No Color
# Quick query script for Neural Nexus
case "$1" in
# Query entire location
warren|1)
echo -e "${CYAN}Querying Heritage Pointe of Warren...${NC}"
npm run query -- location 1 "${2:-15 minutes}"
;;
huntington|4)
echo -e "${CYAN}Querying Heritage Pointe of Huntington...${NC}"
npm run query -- location 4 "${2:-15 minutes}"
;;
hopebridge|5)
echo -e "${CYAN}Querying Hopebridge Autism Center...${NC}"
npm run query -- location 5 "${2:-15 minutes}"
;;
akron|6)
echo -e "${CYAN}Querying Akron Carnegie Public Library...${NC}"
npm run query -- location 6 "${2:-15 minutes}"
;;
church|9)
echo -e "${CYAN}Querying First Church of God...${NC}"
npm run query -- location 9 "${2:-15 minutes}"
;;
byrna|3)
echo -e "${CYAN}Querying Byrna Technologies...${NC}"
npm run query -- location 3 "${2:-15 minutes}"
;;
element|8)
echo -e "${CYAN}Querying Element Labs...${NC}"
npm run query -- location 8 "${2:-15 minutes}"
;;
# List commands
list)
npm run query -- list-locations
;;
list-equipment)
if [ -z "$2" ]; then
echo -e "${RED}Location ID required. Usage: ./query.sh list-equipment <location-id>${NC}"
exit 1
fi
npm run query -- list-equipment "$2"
;;
# Query specific equipment
equipment)
if [ -z "$2" ]; then
echo -e "${RED}Equipment ID required. Usage: ./query.sh equipment <equipment-id> [timeRange]${NC}"
exit 1
fi
npm run query -- equipment "$2" "${3:-15 minutes}"
;;
# Query by location ID
location)
if [ -z "$2" ]; then
echo -e "${RED}Location ID required. Usage: ./query.sh location <location-id> [timeRange]${NC}"
exit 1
fi
npm run query -- location "$2" "${3:-15 minutes}"
;;
# Help
help|--help|-h|"")
echo -e "${BOLD}Neural Nexus Equipment Query Tool${NC}"
echo ""
echo -e "${CYAN}Quick Commands:${NC}"
echo " ./query.sh warren [timeRange] - Query Heritage Warren"
echo " ./query.sh huntington [timeRange] - Query Heritage Huntington"
echo " ./query.sh hopebridge [timeRange] - Query Hopebridge"
echo " ./query.sh akron [timeRange] - Query Akron Library"
echo " ./query.sh church [timeRange] - Query First Church"
echo " ./query.sh byrna [timeRange] - Query Byrna Tech"
echo " ./query.sh element [timeRange] - Query Element Labs"
echo ""
echo -e "${CYAN}General Commands:${NC}"
echo " ./query.sh location <id> [timeRange] - Query any location by ID"
echo " ./query.sh equipment <id> [timeRange] - Query specific equipment"
echo " ./query.sh list - List all locations"
echo " ./query.sh list-equipment <location-id> - List equipment at location"
echo ""
echo -e "${CYAN}Time Range Examples:${NC}"
echo " \"1 minute\", \"5 minutes\", \"15 minutes\", \"1 hour\", \"24 hours\""
echo " Default: 15 minutes"
echo ""
echo -e "${CYAN}Examples:${NC}"
echo " ./query.sh warren - Query Warren (last 15 min)"
echo " ./query.sh warren \"1 hour\" - Query Warren (last hour)"
echo " ./query.sh location 1 - Query location ID 1"
echo " ./query.sh equipment 2JFzwQkC1XwJhUvm09rE - Query specific AHU"
echo ""
echo -e "${YELLOW}Location IDs:${NC}"
echo " 0 - Peabody Retirement"
echo " 1 - Heritage Pointe of Warren"
echo " 2 - Saint Jude Catholic School"
echo " 3 - Byrna Technologies"
echo " 4 - Heritage Pointe of Huntington"
echo " 5 - Hopebridge Autism Center"
echo " 6 - Akron Carnegie Public Library"
echo " 7 - Taylor University"
echo " 8 - Element Labs"
echo " 9 - First Church of God"
echo " 10 - NE Realty Group"
echo " 11 - St John Catholic School"
echo " 13 - Upland Community Church"
;;
*)
echo -e "${RED}Unknown command: $1${NC}"
echo "Use './query.sh help' for usage information"
exit 1
;;
esac