Skip to content

Commit 2c135eb

Browse files
committed
minor fix
1 parent 5a93e4c commit 2c135eb

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

configs/samples/configuration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ riotpot:
3030

3131
#Services which will run at start. For all the services, set `autod` to `true`.
3232
# enter them separated by space
33-
boot: coapd echod
33+
boot: httpd echod telnetd mqttd coapd modbusd
3434

3535
# `start` contains a list of services desired to be run
3636
# on-start.
@@ -45,7 +45,7 @@ riotpot:
4545
# - modbus, oitc/modbus-server, 10.5.0.11
4646

4747
# Fill the mode, low, high or hybrid, to be used in containerized mode
48-
mode: hybrid
48+
mode: low
4949

5050
# Contains a list of available services in the application.
5151
# This gives the user the ability to navigate or load

deployments/docker-compose.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,4 @@ services:
8282
volumes:
8383
- ../test/pkg/services/mqtt:/riotpot/
8484
networks:
85-
honeypot:
86-
87-
mqtt:
88-
image: eclipse-mosquitto
89-
networks:
90-
honeypot:
91-
ipv4_address: 10.5.0.10
92-
93-
http:
94-
image: httpd
95-
networks:
96-
honeypot:
97-
ipv4_address: 10.5.0.12
85+
honeypot:

internal/configuration/autopilot.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,15 @@ func (a *Autopilot) Start() {
154154
fmt.Printf("\nPlugins to run are ")
155155
fmt.Println(a.plugins_to_run)
156156
} else if a.Settings.Riotpot.Mode == "high" {
157+
fmt.Printf("\nContianers to run are ")
158+
fmt.Println(a.containers_to_run)
157159
a.DeployGlider()
158160
} else if a.Settings.Riotpot.Mode == "hybrid" {
159161
a.plugins_to_run = a.Settings.Riotpot.Start
162+
fmt.Printf("\nPlugins to run are ")
163+
fmt.Println(a.plugins_to_run)
164+
fmt.Printf("\nContianers to run are ")
165+
fmt.Println(a.containers_to_run)
160166
a.DeployGlider()
161167
}
162168

@@ -197,15 +203,15 @@ func (a *Autopilot) available(name string, port int) (available bool) {
197203
}
198204

199205
func (a *Autopilot) CheckModesFromConfig() {
200-
mode_received := a.Settings.Riotpot.Mode
206+
mode_received := arrays.StringToArray( a.Settings.Riotpot.Mode)
201207

202208
if len(mode_received) > 1 {
203209
log.Fatalf("\nPlease enter only one mode in Riotpot config mode, i.e. low, high or hybrid\n")
204210
} else if len(mode_received) == 0 {
205211
log.Fatalf("\nPlease enter atleast one mode in Riotpot config mode, i.e. low, high or hybrid\n")
206212
}
207213

208-
if ! arrays.Contains(a.Settings.Riotpot.Allowed_modes, mode_received) {
214+
if ! arrays.Contains(a.Settings.Riotpot.Allowed_modes, mode_received[0]) {
209215
log.Fatalf("\n %q mode is invalid, only choose low, high or hybrid mode only in Riotpot config\n", mode_received[0])
210216
}
211217
}
@@ -291,7 +297,7 @@ func (a *Autopilot) DeployGlider() {
291297
fmt.Println(a.remote_host_ip)
292298

293299
app := environ.GetPath("glider")
294-
environ.ExecuteCmd(app, "-verbose", "-listen", listener, "-forward", forwarder, "&")
300+
environ.ExecuteBackgroundCmd(app, "-verbose", "-listen", listener, "-forward", forwarder, "&")
295301
}
296302
}
297303

0 commit comments

Comments
 (0)