Skip to content

Commit

Permalink
Correction for #32
Browse files Browse the repository at this point in the history
  • Loading branch information
SR-G committed Nov 18, 2021
1 parent f517f18 commit b81aa14
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
BINARY=sol
PWD := $(shell pwd)

VERSION=1.0.6-SNAPSHOT
VERSION=1.0.7-SNAPSHOT
PACKAGE=SleepOnLAN-${VERSION}
BUILD_TIME=$(date "%FT%T%z")

Expand All @@ -31,7 +31,8 @@ conf:
cp resources/sol.json bin/

run:
${GOPATH}/bin/sleep-on-lan
setcap 'cap_net_bind_service=+ep' ${GOPATH}/bin/sleep-on-lan
${GOPATH}/bin/sleep-on-lan -c resources/dev/sol-local-development-configuration.HS-soft-error.json

distribution: install
mkdir -p bin/linux/ bin/windows_amd64/ bin/windows_386/
Expand Down
10 changes: 10 additions & 0 deletions resources/dev/:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Listeners" : ["HTTP:9009" ],
"LogLevel" : "INFO",
"ExitIfAnyPortIsAlreadyUsed" : true,
"UnknownField" : true,
"AvoidDualUDPSending" : {
"Active": false,
"Delay": "100ms"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Listeners" : ["HTTP:9009" ],
"LogLevel" : "INFO",
"ExitIfAnyPortIsAlreadyUsed" : true,
"AvoidDualUDPSending" :
"Active": false,
"Delay": "100ms"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Listeners" : ["HTTP:9009" ],
"LogLevel" : "INFO",
"ExitIfAnyPortIsAlreadyUsed" : true,
"UnknownField" : true,
"AvoidDualUDPSending" : {
"Active": false,
"Delay": "100ms"
}
}
9 changes: 9 additions & 0 deletions resources/dev/sol-local-development-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Listeners" : ["HTTP:9009" ],
"LogLevel" : "INFO",
"ExitIfAnyPortIsAlreadyUsed" : true,
"AvoidDualUDPSending" : {
"Active": false,
"Delay": "100ms"
}
}
2 changes: 2 additions & 0 deletions src/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ func (conf *Configuration) Load(configurationFileName string) {
Info.Println("Configuration file found under [" + colorer.Green(configurationFileName) + "], now reading content")
file, _ := os.Open(configurationFileName)
decoder := json.NewDecoder(file)
decoder.DisallowUnknownFields()
err := decoder.Decode(&conf)
if err != nil {
Error.Println("error while loading configuration :", err)
defer ExitDaemon()
}
} else {
Info.Println("No external configuration file found under [" + colorer.Red(configurationFileName) + "], will use default values")
Expand Down

0 comments on commit b81aa14

Please sign in to comment.