mirror of
https://github.com/ChuckPa/PlexDBRepair.git
synced 2026-02-12 05:56:11 -06:00
Compare commits
1 Commits
f66e972563
...
49588191b6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49588191b6 |
28
DBRepair.sh
28
DBRepair.sh
@@ -1450,13 +1450,6 @@ GetLatestRelease() {
|
||||
DownloadAndUpdate() {
|
||||
url="$1"
|
||||
filename="$2"
|
||||
|
||||
# Check if script path is writable
|
||||
if [ ! -w "$ScriptWorkingDirectory" ]; then
|
||||
Output "Script path is not writable."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Download the file and check if the download was successful
|
||||
if curl -s "$url" --output "$filename"; then
|
||||
Output "Update downloaded successfully"
|
||||
@@ -1611,7 +1604,7 @@ do
|
||||
echo " 11 - 'status' - Report status of PMS (run-state and databases)"
|
||||
echo " 12 - 'undo' - Undo last successful command"
|
||||
echo ""
|
||||
echo " 98 - 'update' - Check for script update"
|
||||
echo " 00 - 'update' - Check for script update"
|
||||
echo " 99 - 'quit' - Quit immediately. Keep all temporary files."
|
||||
echo " 'exit' - Exit with cleanup options."
|
||||
fi
|
||||
@@ -1913,26 +1906,21 @@ do
|
||||
DoUndo
|
||||
;;
|
||||
|
||||
98|upda*)
|
||||
00|update)
|
||||
|
||||
DoUpdate=0
|
||||
Output "Checking for script update"
|
||||
GetLatestRelease
|
||||
if [ $LatestVersion != $Version ] && ([ $Scripted -eq 1 ] || ConfirmYesNo "Download and update script?"); then
|
||||
DoUpdate=1
|
||||
if [ $LatestVersion != $Version ]; then
|
||||
Output "Version update available"
|
||||
else
|
||||
Output "No update available"
|
||||
fi
|
||||
|
||||
if [ $DoUpdate -eq 1 ]; then
|
||||
Output "Performing update"
|
||||
if ConfirmYesNo "Download and update script?"; then
|
||||
DownloadAndUpdate "https://raw.githubusercontent.com/ChuckPa/PlexDBRepair/master/DBRepair.sh" "$ScriptWorkingDirectory/$ScriptName"
|
||||
exit 0
|
||||
else
|
||||
Output "Download aborted"
|
||||
fi
|
||||
|
||||
if [ $Scripted -eq 1 ]; then
|
||||
exit 0
|
||||
else
|
||||
Output "No update available"
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user