Truncated shell $METER_JSON
bkggkt3d opened this issue · comments
Type of request
Bug
OS version
Trixie
wmbusmeters version
master
Your message goes here
The attribute $METER_JSON used within a "shell" command will truncated
Steps to recreate:
- Create a script /usr/local/bin/mergeJSONintoCommonFile with "echo $1 $2"
- Connect a meter GossenMetrawatt U1289 to your M-Bus, maybe the problem is also reproduceible with other meters with unknown driver
- call "wmbusmeters --pollinterval=3s --format=json --shell='/usr/local/bin/mergeJSONintoCommonFile $METER_NAME $METER_JSON' MAIN=/dev/ttyS1:mbus:2400 MBusDevice12 abbb23:MAIN:mbus 04540002 NOKEY
- choose the driver abbb23, or one of abbb23 em24 gransystems iem3000 nemo
- The script will show a JSON string which is truncated. the initial "{" is there, but the closing "}" and some data before is missed
Expected behavior:
- The script shall show the full JSON string including the closing "}", like done when choosing the driver esyswm or omnipower
This is probably a shell problem, you have to quote $METER_JSON like this:
--shell='/usr/local/bin/mergeJSONintoCommonFile $METER_NAME "$METER_JSON" '
Otherwise the spaces inside the json will split at the first space in the json.
This issue is stale because it has been open for 2 month with no activity. Remove stale label or comment or this will be closed in 1 month.