Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--command parameters empty #8

Open
ortizjd opened this issue Mar 14, 2019 · 0 comments
Open

--command parameters empty #8

ortizjd opened this issue Mar 14, 2019 · 0 comments

Comments

@ortizjd
Copy link

ortizjd commented Mar 14, 2019

Hi Everyone!

First off, I want to say this project is fantastic so thank you to anyone who has contributed especially cuppa-joe. I have setup an SDR on my RPi3 using multimon and dsame exactly as described in these examples. I am getting all EAS alerts and decoding them with dsame properly. However, I am trying to call an alert.sh script that will then POST the alert data to my server so I can trigger follow on actions. The script gets called correctly and the POST happens correctly but the parameters are empty. Here are a few more details.

The command I run is:
python dsame.py --source rtl_source.sh --call alert.sh --command "{event}" "{EEE}" "{MESSAGE}"

The contents of rtl_srouce.sh are the exact same as the rtl source file in this repo, with one slight adjustment (the frequency in my area is 162.550M instead of 162.500M).

The contents of alert.sh are as follows:
#!/bin/bash

URL=localhost:1880/v1/weather/alert
EVENT=$1
CODE=$2
MSG=$3

curl -X POST --header "Content-Type: application/json" --data-binary "{"event":"$EVENT","code":"$CODE","msg":"$MSG"}" $URL

As yo can see, I am just trying to read in the 3 parameters and curl to a local service (for now).

What I see when I run this is the proper alert text printed to stdout as well as the following object:
{"event":"","code":"","msg":""}
Naturally, that same object is what gets POSTed to my API service.

Am I missing something obvious to get the parameters to be passed into alert.sh?

Thank you!
Jason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant