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