diff options
-rwxr-xr-x | print-status-html | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/print-status-html b/print-status-html index 4babe08..6a8f12c 100755 --- a/print-status-html +++ b/print-status-html @@ -69,28 +69,28 @@ EOF T p ' /proc/mdstat \ - | sort -u \ - | while read -r line; do - if [ -z "${line%%* finish=*min*}" ]; then - duration="${line##* finish=}" - duration="${duration%%min*}" - time=$( - date +'%F %T' -d@$(( - $(date +%s) + $(echo "60 * ${duration}" | bc -l | sed 's/\..*$//') - )) - ) - printf '%s (%s)\n' "${line}" "${time}" - else - printf '%s\n' "${line}" - fi - done \ - | sed ' - s,.*\[U\+\]$,<font color="#008000">\0</font>, - t - s,^\(re\(shape\|covery\|sync\) \S\+\) \[\(\S*\)>\(\.*\)\] \(\S\+\s\+\S\+\s\+\S\+\)$,<font color="#808000">\1</font> <tt>[<font color="#008000">\3</font><font color="#808000">\></font><font color="#800000">\4</font>]</tt> \5, - t - s,.*,<font color="#800000">\0</font>, - ' + | sort -u \ + | while read -r line; do + if [ -z "${line%%* finish=*min*}" ]; then + duration="${line##* finish=}" + duration="${duration%%min*}" + time=$( + date +'%F %T' -d@$(( + $(date +%s) + $(echo "60 * ${duration}" | bc -l | sed 's/\..*$//') + )) + ) + printf '%s (%s)\n' "${line}" "${time}" + else + printf '%s\n' "${line}" + fi + done \ + | sed ' + s,.*\[U\+\]$,<font color="#008000">\0</font>, + t + s,^\(re\(shape\|covery\|sync\) \S\+\) \[\(\S*\)>\(\.*\)\] \(\S\+\s\+\S\+\s\+\S\+\)$,<font color="#808000">\1</font> <tt>[<font color="#008000">\3</font><font color="#808000">\></font><font color="#800000">\4</font>]</tt> \5, + t + s,.*,<font color="#800000">\0</font>, + ' find /sys/block/ -mindepth 1 -maxdepth 1 -name 'md*' -printf '%f\n' \ | sed 's@^md@@' \ |