mirror of
https://github.com/007revad/Synology_HDD_db.git
synced 2026-04-25 13:45:59 +03:00
[GH-ISSUE #27] Script trying to update from root dir instead of working directory where file is located #518
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Synology_HDD_db#518
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sthulin on GitHub (Mar 22, 2023).
Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/27
There is a newer version of this script available. Current version: v1.2.19 Latest version: v1.2.20 Do you want to download v1.2.20 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 497k 0 --:--:-- --:--:-- --:--:-- 931k curl: Saved to filename 'Synology_HDD_db-1.2.20.tar.gz' ERROR /root/Synology_HDD_db-1.2.20.tar.gz not found!Perhaps you can have it download to the directory the script is in instead? Or maybe /tmp?
@007revad commented on GitHub (Mar 22, 2023):
Are you running the script as root or as a user with sudo
@007revad commented on GitHub (Mar 22, 2023):
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
@sthulin commented on GitHub (Mar 23, 2023):
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.
@007revad commented on GitHub (Mar 23, 2023):
I just updated the script to v1.2.23 https://github.com/007revad/Synology_HDD_db
@sthulin commented on GitHub (Mar 23, 2023):
ok thanks, i've downloaded that but i need to wait until v1.2.24 to check
@007revad commented on GitHub (Mar 23, 2023):
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"toscriptver="v1.2.22"then save the change and run the script.@sthulin commented on GitHub (Mar 24, 2023):
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.
@007revad commented on GitHub (Mar 24, 2023):
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.
@007revad commented on GitHub (Mar 26, 2023):
The latest version, v1.2.27, now:
@sthulin commented on GitHub (Mar 26, 2023):
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
@sthulin commented on GitHub (Mar 27, 2023):
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.
@007revad commented on GitHub (Mar 27, 2023):
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.@sthulin commented on GitHub (Mar 27, 2023):
looks like its working now. this is great stuff!