diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-07-06 23:46:05 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-07-06 23:48:54 +0300 |
commit | 53d02fe96ddd03cbe76820cee073179e501918dc (patch) | |
tree | a198846c7df73205304a6bd4d67d53f6fc74b3fa | |
parent | e3cab9b1189682eb11811aa0a3036e5ba1681b37 (diff) |
nc-hdd-monitor: fix detectionv1.14.2
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r-- | bin/ncp/SYSTEM/nc-hdd-monitor.sh | 24 | ||||
-rw-r--r-- | changelog.md | 6 |
2 files changed, 18 insertions, 12 deletions
diff --git a/bin/ncp/SYSTEM/nc-hdd-monitor.sh b/bin/ncp/SYSTEM/nc-hdd-monitor.sh index e88efa3b..e4c0976a 100644 --- a/bin/ncp/SYSTEM/nc-hdd-monitor.sh +++ b/bin/ncp/SYSTEM/nc-hdd-monitor.sh @@ -24,17 +24,12 @@ configure() } [[ "$ACTIVE" != yes ]] && { - update-rc.d smartd disable - service smartd stop + systemctl disable smartd + service smartd stop echo "HDD monitor disabled" return 0 } - cat > /etc/smartd.conf <<EOF -# short scan every day at 1am, long one on sundays at 2am -DEVICESCAN -a -m $EMAIL -M exec /usr/local/etc/ncp-hdd-notif.sh -s (S/../.././01|L/../../7/02) -EOF - cat > /usr/local/etc/ncp-hdd-notif.sh <<EOF #!/bin/bash EOF @@ -57,16 +52,25 @@ sudo -u www-data php /var/www/nextcloud/occ notification:generate \ EOF chmod +x /usr/local/etc/ncp-hdd-notif.sh + cat > /etc/smartd.conf <<EOF +# short scan every day at 1am, long one on sundays at 2am +EOF + for dr in "${DRIVES[@]}"; do local type="" smartctl -d test /dev/${dr} &>/dev/null || { smartctl -d sat -i /dev/${dr} &>/dev/null && type="-d sat" } - smartctl $type --smart=on /dev/${dr} | sed 1,2d; + smartctl ${type} --smart=on /dev/${dr} | sed 1,2d; + + cat >> /etc/smartd.conf <<EOF +/dev/${dr} -a ${type} -m ${EMAIL} -M exec /usr/local/etc/ncp-hdd-notif.sh -s (S/../.././01|L/../../7/02) +EOF + done - update-rc.d smartd enable - service smartd start + systemctl enable smartd + service smartd start echo "HDD monitor enabled" } diff --git a/changelog.md b/changelog.md index 82f81b79..9f3d05bd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,9 @@ -[v1.14.0](https://github.com/nextcloud/nextcloudpi/commit/22e9dca) (2019-07-05) upgrade to NC16.0.2 +[v1.14.2](https://github.com/nextcloud/nextcloudpi/commit/60898da) (2019-07-06) nc-hdd-monitor: fix detection -[v1.13.6](https://github.com/nextcloud/nextcloudpi/commit/88da901) (2019-06-29) ncp-update: fixes on the new step based upgrade system +[v1.14.0 ](https://github.com/nextcloud/nextcloudpi/commit/fa9ddca) (2019-07-05) upgrade to NC16.0.2 + +[v1.13.6 ](https://github.com/nextcloud/nextcloudpi/commit/88da901) (2019-06-29) ncp-update: fixes on the new step based upgrade system [v1.13.5 ](https://github.com/nextcloud/nextcloudpi/commit/fbdab43) (2019-06-29) ncp-web: adjust ipv6 local restrictions |