Skip to content

Commit

Permalink
Escape double quotes in device model family (#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
vetal4444 authored and SuperQ committed Jan 24, 2018
1 parent 111e3af commit 4ed49e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion text_collector_examples/smartmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ parse_smartctl_info() {
local model_family='' device_model='' serial_number='' fw_version='' vendor='' product='' revision='' lun_id=''
while read line ; do
info_type="$(echo "${line}" | cut -f1 -d: | tr ' ' '_')"
info_value="$(echo "${line}" | cut -f2- -d: | sed 's/^ \+//g')"
info_value="$(echo "${line}" | cut -f2- -d: | sed 's/^ \+//g' | sed 's/"/\\"/')"
case "${info_type}" in
Model_Family) model_family="${info_value}" ;;
Device_Model) device_model="${info_value}" ;;
Expand Down

0 comments on commit 4ed49e7

Please sign in to comment.