From 5cb43786c5ed4360d927041e65edf2769e163d22 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sat, 3 Aug 2024 17:50:49 +1000 Subject: [PATCH] Update syno_hdd_db.sh v3.5.98 - Changed to install dtc automatically if needed and script is running from task scheduler. --- syno_hdd_db.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 588df1c..1acb4bc 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,7 +29,7 @@ # /var/packages/StorageManager/target/ui/storage_panel.js -scriptver="v3.5.97" +scriptver="v3.5.98" script=Synology_HDD_db repo="007revad/Synology_HDD_db" scriptname=syno_hdd_db @@ -1564,6 +1564,33 @@ EOM2D17 fi } +is_schedule_running(){ + # $1 is script's filename. e.g. syno_hdd_db.sh etc + local file="/usr/syno/etc/esynoscheduler/esynoscheduler.db" + local rows offset task status pid result + + # Get number of rows in database + rows=$(sqlite3 "${file}" < # example: @@ -1580,6 +1607,8 @@ install_binfile(){ # Download binfile if [[ $autoupdate == "yes" ]]; then reply=y + elif is_schedule_running "$(basename -- "$0")"; then + reply=y else echo -e "\nNeed to download ${1}" echo -e "${Cyan}Do you want to download ${1}?${Off} [y/n]"