Compare commits

..

2 Commits

Author SHA1 Message Date
causefx
f576274e66 Merge e63b7552bb into 47bd6e7c56 2023-10-11 20:31:19 -07:00
causefx
e63b7552bb Update DBRepair.sh 2023-10-11 20:31:04 -07:00

View File

@@ -1451,12 +1451,6 @@ DownloadAndUpdate() {
url="$1" url="$1"
filename="$2" 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 # Download the file and check if the download was successful
if curl -s "$url" --output "$filename"; then if curl -s "$url" --output "$filename"; then
Output "Update downloaded successfully" Output "Update downloaded successfully"
@@ -1922,15 +1916,20 @@ do
DoUpdate=1 DoUpdate=1
Output "Version update available" Output "Version update available"
else else
Output "No update available" Output "No update available or user declined update"
fi fi
# Check if script path is writable
if [ $DoUpdate -eq 1 ]; then if [ $DoUpdate -eq 1 ]; then
Output "Performing update" if [ -w "$ScriptWorkingDirectory" ]; then
DownloadAndUpdate "https://raw.githubusercontent.com/ChuckPa/PlexDBRepair/master/DBRepair.sh" "$ScriptWorkingDirectory/$ScriptName" Output "Performing update"
exit 0 DownloadAndUpdate "https://raw.githubusercontent.com/ChuckPa/PlexDBRepair/master/DBRepair.sh" "$ScriptWorkingDirectory/$ScriptName"
exit 0
else
Output "Script path is not writable."
fi
fi fi
if [ $Scripted -eq 1 ]; then if [ $Scripted -eq 1 ]; then
exit 0 exit 0
fi fi