Merge pull request #329 from justincormack/diskdetect

Tweak disk detection diagnostics to match what is going on better
This commit is contained in:
Justin Cormack 2016-07-21 16:15:04 +01:00 committed by GitHub
commit abf4ba2288

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
printf '\n' printf '\n'
DEV=$(ls /dev | grep '[sxv]da$') DEV="$(lsblk -r | grep ' disk $' | awk '{print $1}' | head -1 )"
[ $? -eq 0 ] && printf "✓ Drive found: $DEV\n" || printf "✗ No drive found\n" [ $? -eq 0 ] && printf "✓ Drive found: $DEV\n" || printf "✗ No drive found\n"
DEV=$(mount | grep '/dev/[sxv]da. on /var type') DEV=$(mount | grep '/dev/.*da. on /var type')
[ $? -eq 0 ] && printf "✓ Drive mounted: $DEV\n" || printf "✗ No drive mounted\n" [ $? -eq 0 ] && printf "✓ Drive mounted: $DEV\n" || printf "✗ No drive mounted\n"
INET=$(ifconfig eth0 2> /dev/null | grep 'inet addr') INET=$(ifconfig eth0 2> /dev/null | grep 'inet addr')
[ $? -eq 0 ] && printf "✓ Network connected: $INET\n" || printf "✗ No network connection\n" [ $? -eq 0 ] && printf "✓ Network connected: $INET\n" || printf "✗ No network connection\n"