Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
skripting-section:bash:disk-monitoring-skript [2018/01/08 13:16] – [Skript Sourcecode] michael | skripting-section:bash:disk-monitoring-skript [2018/09/25 13:52] (current) – [Skript Sourcecode] michael | ||
---|---|---|---|
Line 9: | Line 9: | ||
#!/bin/bash | #!/bin/bash | ||
############################################################################################ | ############################################################################################ | ||
- | # | + | # |
############################################################################################ | ############################################################################################ | ||
Line 20: | Line 20: | ||
# Before disk-check test, that disk is mounted! | # Before disk-check test, that disk is mounted! | ||
#if grep " | #if grep " | ||
+ | |||
+ | uhubctl -a on -p 3 | ||
+ | sleep 10 | ||
## System dependency Check: | ## System dependency Check: | ||
if [ -n " | if [ -n " | ||
Line 35: | Line 38: | ||
# Create Disk Smart-OUTPUT and check Status: | # Create Disk Smart-OUTPUT and check Status: | ||
- | OUTPUT=" | + | OUTPUT=" |
echo " | echo " | ||
if [ " | if [ " | ||
then | then | ||
echo "Disk is Healty!" | echo "Disk is Healty!" | ||
- | exit 0 | ||
else | else | ||
echo "Disk detected a SMART-Error!" | echo "Disk detected a SMART-Error!" | ||
Line 49: | Line 51: | ||
-o tls=yes \ | -o tls=yes \ | ||
-xu " | -xu " | ||
- | -xp "" | + | -xp "PASSWORD" \ |
-o message-file="/ | -o message-file="/ | ||
fi | fi | ||
+ | # Poweroff Disk and exit program: | ||
+ | uhubctl -a off -p 3 | ||
exit 0 | exit 0 | ||
#else | #else | ||
Line 57: | Line 61: | ||
#fi | #fi | ||
</ | </ | ||
- |