From 7ca8e6daa42d5fd12b458326b187d3e919938269 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 12 Apr 2013 15:24:51 +0200 Subject: [PATCH] escape smart drives path --- scripts/disco_smart_sudo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/disco_smart_sudo b/scripts/disco_smart_sudo index 47dcf17..46e7af0 100644 --- a/scripts/disco_smart_sudo +++ b/scripts/disco_smart_sudo @@ -1,9 +1,10 @@ -#!/bin/bash +#!/bin/sh echo -e "{\n\t\"data\":[\n\n" for DISK in $(smartctl --scan-open | cut -d' ' -f1); do smartctl -A $DISK >/dev/null 2>&1 if [ $? -eq 0 ]; then + DISK=$(echo $DISK | sed -e 's|/|\\/|g') echo -e "\t{\n" echo -e "\t\t\"{#SMARTDRIVE}\":\"$DISK\"" echo -e "\t}"