Giter Site home page Giter Site logo

Comments (13)

sthulin avatar sthulin commented on May 25, 2024 1

ok thanks, i've downloaded that but i need to wait until v1.2.24 to check

from synology_hdd_db.

sthulin avatar sthulin commented on May 25, 2024 1

looks like its working now. this is great stuff!

/volume1/Stuff/Stuff/Scripts$ sudo ./syno_hdd_db.sh 
Synology_HDD_db v1.2.29
DS1817+-j DSM 6.2.4-25556 
Using model: ds1817+

There is a newer version of this script available.
Current version: v1.2.29
Latest version:  v1.2.30
Do you want to download v1.2.30 now? [y/n]
y
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  248k    0  248k    0     0   526k      0 --:--:-- --:--:-- --:--:--  526k
curl: Saved to filename 'Synology_HDD_db-1.2.30.tar.gz'

v1.2.30 and changes.txt downloaded to: /volume1/Stuff/Stuff/Scripts
Do you want to stop this script so you can run the new one? [y/n]
y

:/volume1/Stuff/Stuff/Scripts$ ls
CHANGES.txt  syno_hdd_db.sh

:/volume1/Stuff/Stuff/Scripts$ sudo ./syno_hdd_db.sh 
Synology_HDD_db v1.2.30
DS1817+-j DSM 6.2.4-25556 
Using model: ds1817+

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

Are you running the script as root or as a user with sudo <script>?

We definitely don't want to be downloading stuff to /root because if it gets to full it can cause DSM updates to fail.

Since I download the new version's tar.gz release then untar it and delete the .tar.gz file I should be downloading it to /tmp.
And unpacking it to the script's location is a good idea because then I don't have to check if the person has home services enabled.

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

curl: Saved to filename 'Synology_HDD_db-1.2.20.tar.gz' ERROR /root/Synology_HDD_db-1.2.20.tar.gz not found!

This raises the question of where did curl save the file to? You must have a copy of Synology_HDD_db-1.2.20.tar.gz somewhere. It might be in / or in /var/services/homes

from synology_hdd_db.

sthulin avatar sthulin commented on May 25, 2024

i'm logged in as a user using sudo. It downloaded the file to the working directory i was in (just also happens to be the script directory). So why it's going to /root/ to find it is beyond me since that's not where it is.

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

I just updated the script to v1.2.23 https://github.com/007revad/Synology_HDD_db

  • Changed 'latest version check' to download to /tmp and extract files to the script's location.

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

If you have a text editor that won't change the line endings (like Notepad++) you can edit line 92 of the script to make it think it's an earlier version.

Change this line: scriptver="v1.2.23" to scriptver="v1.2.22" then save the change and run the script.

from synology_hdd_db.

sthulin avatar sthulin commented on May 25, 2024

so i did that on a 1.2.23 and its not overwriting my file. I see a .23 folder and contents in /tmp, so it's just not overwriting the file i was executing.

/volume1/Stuff/Stuff/Scripts$ sudo ./syno_hdd_db.sh 
Password: 
Synology_HDD_db v1.2.22
DS1817+-j DSM 6.2.4 
Using model: ds1817+

There is a newer version of this script available.
Current version: v1.2.22
Latest version:  v1.2.23
Do you want to download v1.2.23 now? {y/n]
y
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  239k    0  239k    0     0   373k      0 --:--:-- --:--:-- --:--:--  373k
curl: Saved to filename 'Synology_HDD_db-1.2.23.tar.gz'

v1.2.23 and changes.txt are in  ./Synology_HDD_db-1.2.23
Do you want to stop this script so you can run the new one? {y/n]
y

/volume1/Stuff/Stuff/Scripts$ sudo ./syno_hdd_db.sh 
Synology_HDD_db v1.2.22
DS1817+-j DSM 6.2.4 
Using model: ds1817+

There is a newer version of this script available.
Current version: v1.2.22
Latest version:  v1.2.23
Do you want to download v1.2.23 now? {y/n]

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

The .tar.gz file in /tmp should have been deleted after it was unpacked. If you're using WinSCP make sure to refresh the directory contents (Ctrl+R).

It currently does not replace the existing script. I thought the user may want to keep both the old version and the new version.
I did want to replace the existing script with the new one and automatically launch it in the shell but I couldn't figure out how to make the script exit and launch itself.

Your copy and paste just made me realise that once the script closes after updating all the user has to do is press the up arrow and press enter to launch the updated script. So I need a way to overwrite the script without it affecting the currently running old script (so it exits cleanly without error. I have a few thoughts.

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

The latest version, v1.2.27, now:

  1. Downloads the .tar.gz file to /tmp
  2. Unpacks it to /tmp/Synology_HDD_db-
  3. Copies the syno_hdd_db.sh and README.txt to running script's location, overwriting the existing syno_hdd_db.sh and README.txt files.
  4. Deletes the /tmp/Synology_HDD_db-.tar.gz file and /tmp/Synology_HDD_db- folder.

from synology_hdd_db.

sthulin avatar sthulin commented on May 25, 2024

so i grabbed the latest file and modified it to think it's .26 ... i'm not sure where its copying the file to, but it didn't overwrite it and there was no new readme file

/volume1/Stuff/Stuff/Scripts$ sudo ./syno_hdd_db.sh 
Synology_HDD_db v1.2.26
DS1817+-j DSM 6.2.4-25556 
Using model: ds1817+

There is a newer version of this script available.
Current version: v1.2.26
Latest version:  v1.2.27
Do you want to download v1.2.27 now? [y/n]
y
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  247k    0  247k    0     0   409k      0 --:--:-- --:--:-- --:--:--  409k
curl: Saved to filename 'Synology_HDD_db-1.2.27.tar.gz'

v1.2.27 and changes.txt downloaded to: .
Do you want to stop this script so you can run the new one? [y/n]
y

/volume1/Stuff/Stuff/Scripts$ ls
syno_hdd_db.sh

/volume1/Stuff/Stuff/Scripts$ sudo ./syno_hdd_db.sh 
Synology_HDD_db v1.2.26
DS1817+-j DSM 6.2.4-25556 
Using model: ds1817+

There is a newer version of this script available.
Current version: v1.2.26
Latest version:  v1.2.27
Do you want to download v1.2.27 now? [y/n]

from synology_hdd_db.

sthulin avatar sthulin commented on May 25, 2024

so it just seems to be that it can't handle . as the directory. If i type out the full path it downloads and overwrites the file.

:sudo /volume1/Stuff/Stuff/Scripts/syno_hdd_db.sh 
Synology_HDD_db v1.2.28
DS1817+-j DSM 6.2.4-25556 
Using model: ds1817+

There is a newer version of this script available.
Current version: v1.2.28
Latest version:  v1.2.29
Do you want to download v1.2.29 now? [y/n]
y
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  247k    0  247k    0     0   647k      0 --:--:-- --:--:-- --:--:--  647k
curl: Saved to filename 'Synology_HDD_db-1.2.29.tar.gz'

v1.2.29 and changes.txt downloaded to: /volume1/Stuff/Stuff/Scripts
Do you want to stop this script so you can run the new one? [y/n]
y

:/volume1/Stuff/Stuff/Scripts$ ls
CHANGES.txt  syno_hdd_db.sh

:/volume1/Stuff/Stuff/Scripts$ sudo /volume1/Stuff/Stuff/Scripts/syno_hdd_db.sh 
Synology_HDD_db v1.2.29
DS1817+-j DSM 6.2.4-25556 
Using model: ds1817+

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

Yes. I just noticed the ./ in your comment a few of hours ago.

I've now got it working correctly when run with ./ and when run run via a symlink (in case someone creates a symlink in /usr/bin etc that points to where the .sh file is). I also added some error checking and error messages if any step in the download/update process fails.

Can you try v1.2.30
https://github.com/007revad/Synology_HDD_db/releases

You'll need to edit the scriptver="v1.2.30" on line 95 to a lower number to test it.

from synology_hdd_db.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.