Guest User

Untitled

a guest
Jun 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. #sg=2
  4. if [ "$USER" != "root" ]; then echo "[ERROR] You are not root."; exit 1; fi
  5. if [ -z "$sg" ]; then sg=0; fi
  6. for i in $( seq "$sg" 3 ); do
  7. for j in $( seq 1 28 ); do
  8. res="$( smartctl -d areca,"$j" -a "/dev/sg${i}" | \
  9. grep -Ei "model|serial|result|capacity" | \
  10. sed -Ee 's/ Number|User Capacity| [0-9].*bytes//g' \
  11. -e 's/SMART overall-health self-assessment test result://g' )"
  12. if [ ! -z "$res" ]; then printf "%s: %s\n" "$j" "$( echo $res )"; fi
  13. done
  14. done
Add Comment
Please, Sign In to add comment