[GH-ISSUE #563] Function to check options flag broken in v3.6.121 #205

Closed
opened 2026-03-07 19:17:02 +03:00 by kerem · 3 comments
Owner

Originally created by @jjlizz on GitHub (Feb 13, 2026).
Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/563

Well I'm playing around with the newest script on my DS1525+ with DSM 7.3.2-86009 Update 1.
I'm running the script using:

syno_hdd_db.sh --autoupdate=0 -n

But flag -n does not function.
Here's what I found:
In older version like v3.6.119, the following code(in syno_hdd_db.sh, around line 115) is used to check option flags

if options="$(getopt -o SIabcdefghijklmnopqrstuvwxyz0123456789 -l \
    ssd:,ihm,restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,pcie,wdda,email,autoupdate:,help,version,debug \
    -- "$@")"; then
    eval set -- "$options"

For newest version, the code has been changed to

if options="$(getopt -o SIabcdefghijklmnopqrstuvwxyz0123456789 -l \
    ssd:,ihm,restore,showedits,noupdate,nodbupdate,m2,force,\
    incompatible,ram,pcie,wdda,email,autoupdate:,reboot,help,version,debug \
    -- "$@")"; then
    eval set -- "$options"

Under this condition, getopt does not work properly and always output "--" as the result, causing all flags invalid.
I just deleted all "\" in the code as below and everything is fine.

if options="$(getopt -o SIabcdefghijklmnopqrstuvwxyz0123456789 -l ssd:,ihm,restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,pcie,wdda,email,autoupdate:,reboot,help,version,debug -- "$@")"; then
    eval set -- "$options"

Hope this would help.

Originally created by @jjlizz on GitHub (Feb 13, 2026). Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/563 Well I'm playing around with the newest script on my DS1525+ with DSM 7.3.2-86009 Update 1. I'm running the script using: ``` syno_hdd_db.sh --autoupdate=0 -n ``` But flag -n does not function. Here's what I found: In older version like v3.6.119, the following code(in syno_hdd_db.sh, around line 115) is used to check option flags ``` if options="$(getopt -o SIabcdefghijklmnopqrstuvwxyz0123456789 -l \ ssd:,ihm,restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,pcie,wdda,email,autoupdate:,help,version,debug \ -- "$@")"; then eval set -- "$options" ``` For newest version, the code has been changed to ``` if options="$(getopt -o SIabcdefghijklmnopqrstuvwxyz0123456789 -l \ ssd:,ihm,restore,showedits,noupdate,nodbupdate,m2,force,\ incompatible,ram,pcie,wdda,email,autoupdate:,reboot,help,version,debug \ -- "$@")"; then eval set -- "$options" ``` Under this condition, getopt does not work properly and always output "--" as the result, causing all flags invalid. I just deleted all "\\" in the code as below and everything is fine. ``` if options="$(getopt -o SIabcdefghijklmnopqrstuvwxyz0123456789 -l ssd:,ihm,restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,pcie,wdda,email,autoupdate:,reboot,help,version,debug -- "$@")"; then eval set -- "$options" ``` Hope this would help.
kerem closed this issue 2026-03-07 19:17:02 +03:00
Author
Owner

@007revad commented on GitHub (Feb 13, 2026):

I've fixed the getopts issue. Can you try this one:
https://github.com/007revad/Synology_HDD_db/blob/develop/syno_hdd_db.sh

<!-- gh-comment-id:3898074641 --> @007revad commented on GitHub (Feb 13, 2026): I've fixed the getopts issue. Can you try this one: https://github.com/007revad/Synology_HDD_db/blob/develop/syno_hdd_db.sh
Author
Owner

@jjlizz commented on GitHub (Feb 14, 2026):

I've fixed the getopts issue. Can you try this one: https://github.com/007revad/Synology_HDD_db/blob/develop/syno_hdd_db.sh

Duplicated code at line 120. The other parts seem good.

<!-- gh-comment-id:3900401960 --> @jjlizz commented on GitHub (Feb 14, 2026): > I've fixed the getopts issue. Can you try this one: https://github.com/007revad/Synology_HDD_db/blob/develop/syno_hdd_db.sh Duplicated code at line 120. The other parts seem good.
Author
Owner

@007revad commented on GitHub (Feb 14, 2026):

Fixed and released.
https://github.com/007revad/Synology_HDD_db/releases/tag/v3.6.122

<!-- gh-comment-id:3901310424 --> @007revad commented on GitHub (Feb 14, 2026): Fixed and released. https://github.com/007revad/Synology_HDD_db/releases/tag/v3.6.122
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Synology_HDD_db#205
No description provided.