Compare commits

..

1 Commits

Author SHA1 Message Date
causefx
212162dece Merge cfddb949c4 into 47bd6e7c56 2023-10-11 08:54:56 -07:00

View File

@@ -1451,6 +1451,12 @@ 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"
@@ -1916,18 +1922,13 @@ do
DoUpdate=1
Output "Version update available"
else
Output "No update available or user declined update"
Output "No update available"
fi
# Check if script path is writable
if [ $DoUpdate -eq 1 ]; then
if [ -w "$ScriptWorkingDirectory" ]; then
Output "Performing update"
DownloadAndUpdate "https://raw.githubusercontent.com/ChuckPa/PlexDBRepair/master/DBRepair.sh" "$ScriptWorkingDirectory/$ScriptName"
exit 0
else
Output "Script path is not writable."
fi
Output "Performing update"
DownloadAndUpdate "https://raw.githubusercontent.com/ChuckPa/PlexDBRepair/master/DBRepair.sh" "$ScriptWorkingDirectory/$ScriptName"
exit 0
fi
if [ $Scripted -eq 1 ]; then