Compare commits

...

2 Commits

Author SHA1 Message Date
Dave Russell 05a0fa3215
v3.6.136 2 weeks ago
Dave Russell 73e715913a
Update CHANGES.txt for version 3.6.136 2 weeks ago
  1. 9
      CHANGES.txt
  2. 39
      syno_hdd_db.sh

9
CHANGES.txt

@ -1,7 +1,12 @@
v3.6.136
- Added messages when write mostly options were used but write mostly cannot be set. Issue #602
- Message for when the `-S` option is used and there are no internal 2.5 inch SDDs found.
- Message for when the user used `-ssd=nvmeNnN` as NVMe drives do not contain DSM system or swap partitions.
v3.6.135
- Changed to replace curly/smart quotes (from db files edited in Word or in iOS) before backing db files to prevent jq errors.
- Changed to replace curly/smart quotes (from db files edited in Word or in iOS) before backing up db files to prevent jq errors.
- Added `/usr/syno/bin` or `/usr/syno/sbin` to the syno... commmands that were missing the full path (for people with a corrupt or edited PATH). Issue #601
- The change above also fixes js errors caused by those commmands not returning anything. Issue #601
- The change above also fixes jq errors caused by those commmands not returning anything. Issue #601
- Bug fix for not detecting script was running from triggered scheduled task.
v3.6.134

39
syno_hdd_db.sh

@ -29,7 +29,7 @@
# /var/packages/StorageManager/target/ui/storage_panel.js
scriptver="v3.6.135"
scriptver="v3.6.136"
script=Synology_HDD_db
repo="007revad/Synology_HDD_db"
scriptname=syno_hdd_db
@ -260,11 +260,13 @@ fi
detect_scheduler(){
# SYNO.Core.TaskS is regular scheduled task
# SYNO.Core.Event is triggered scheduled task
local pid=$PPID
local comm
while [[ "$pid" != "1" && -n "$pid" ]]; do
comm=$(ps -p "$pid" -o comm=)
[[ "$comm" =~ (SYNO.Core.TaskS|SYNO.Core.Event|systemd-run|sched|crond) ]] && return 0
[[ "$comm" =~ (SYNO.Core.TaskS|SYNO.Core.Event|crond) ]] && return 0
pid=$(ps -p "$pid" -o ppid= | tr -d ' ')
done
return 1
@ -358,12 +360,12 @@ fi
if [[ -f "/var/lib/disk-compatibility/${model}_host_v7.version" ]]; then
echo -n "- ${model}_host_v7 version "
cat "/var/lib/disk-compatibility/${model}_host_v7.version"
echo -e "\n"
#echo -e "\n"
fi
if [[ -f "/var/lib/disk-compatibility/${model}_host.version" ]]; then
echo -n "- ${model}_host version "
cat "/var/lib/disk-compatibility/${model}_host.version"
echo -e "\n"
#echo -e "\n"
fi
@ -375,6 +377,19 @@ fi
#echo "" # To keep output readable
# Check if script is running in an interactive shell or from schedule
if [[ -t 1 ]]; then # Running in terminal
echo -e "- Running in an interactive shell (user terminal).\n"
else
# Check if running via task scheduler
if detect_scheduler; then
sch_task="yes"
color="no"
fi
echo -e "- Running from a scheduled task.\n"
fi
# shellcheck disable=SC2317 # Don't warn about unreachable commands in this function
pause(){
# When debugging insert pause command where needed
@ -2272,11 +2287,15 @@ if [[ $ssd == "yes" ]]; then
elif [[ ${#ssds_writemostly[@]} -gt "0" ]]; then
# User specified their fast drive(s)
echo -e "\nSetting slow internal HDDs state to write_mostly"
for idrive in "${internal_drives[@]}"; do
if [[ ! ${ssds_writemostly[*]} =~ $idrive ]]; then
set_writemostly writemostly "$idrive"
fi
done
if [[ ${ssds_writemostly[*]} =~ "nvme" ]]; then
echo "NVMe drives don't have DSM system or swap partitions"
else
for idrive in "${internal_drives[@]}"; do
if [[ ! ${ssds_writemostly[*]} =~ $idrive ]]; then
set_writemostly writemostly "$idrive"
fi
done
fi
else
# Get list of internal HDDs and qty of SSDs
@ -2301,6 +2320,8 @@ if [[ $ssd == "yes" ]]; then
for idrive in "${internal_hdds[@]}"; do
set_writemostly writemostly "$idrive"
done
else
echo -e "\nNo internal 2.5 inch SSDs found so not setting write mostly on the HDDs"
fi
fi
fi

Loading…
Cancel
Save