diff --git a/README.md b/README.md index 032f134..4a6ed8c 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ Now within the LAN that contains the sonos devices run bonob the registration pr ```bash docker run \ + --rm \ --network host \ simojenki/bonob register https://my-server.example.com/bonob ``` diff --git a/src/register.ts b/src/register.ts index 28cbd7c..f6fd9c4 100644 --- a/src/register.ts +++ b/src/register.ts @@ -9,7 +9,17 @@ if (params.length != 1) { } const bonobUrl = new URLBuilder(params[0]!); -registrar(bonobUrl)().then((success) => { - if (success) console.log(`Successfully registered bonob @ ${bonobUrl} with sonos`); - else console.error(`Failed registering bonob @ ${bonobUrl} with sonos`); -}); +registrar(bonobUrl)() + .then((success) => { + if (success) { + console.log(`Successfully registered bonob @ ${bonobUrl} with sonos`); + process.exit(0); + } else { + console.error(`Failed registering bonob @ ${bonobUrl} with sonos`); + process.exit(1); + } + }) + .catch((e) => { + console.error(e); + process.exit(1); + });