From 1c4a63178b4f3e7124cc525180a0a1a916f1887e Mon Sep 17 00:00:00 2001 From: Chuck Date: Tue, 23 Jun 2026 15:45:24 -0400 Subject: [PATCH] v 1.16.00 Add mutli-location support for PlexMediaServer.app on MacOS Add Buttons for Coffee donations. --- DBRepair.sh | 63 ++++++++++++++++++++++++++++++---------------------- README.md | 1 + ReleaseNotes | 7 ++++++ 3 files changed, 45 insertions(+), 26 deletions(-) diff --git a/DBRepair.sh b/DBRepair.sh index 2aca8a8..679fa13 100755 --- a/DBRepair.sh +++ b/DBRepair.sh @@ -701,38 +701,49 @@ HostConfig() { HostType="ASUSTOR" return 0 - # Apple Mac - elif [ -d "/Applications/Plex Media Server.app" ] && \ - [ -d "$HOME/Library/Application Support/Plex Media Server" ]; then + elif [ "$(uname)" = "Darwin" ] && [ -d "$HOME/Library/Application Support/Plex Media Server" ]; then - # Where is the software - PLEX_SQLITE="/Applications/Plex Media Server.app/Contents/MacOS/Plex SQLite" - AppSuppDir="$HOME/Library/Application Support" - DBDIR="$AppSuppDir/Plex Media Server/Plug-in Support/Databases" - CACHEDIR="$HOME/Library/Caches/PlexMediaServer/PhotoTranscoder" - LOGFILE="$DBDIR/DBRepair.log" - LOG_TOOL="logger" - TMPDIR="/tmp" - SYSTMP="$TMPDIR" + # Determine where the application bundle is installed + if [ -d "/Applications/Plex Media Server.app" ]; then + PkgDir="/Applications/Plex Media Server.app" + elif [ -d "$HOME/Applications/Plex Media Server.app" ]; then + PkgDir="$HOME/Applications/Plex Media Server.app" + else + # It is a Mac, but the .app bundle cannot be found + PkgDir="" + fi - # MacOS uses pgrep and uses different stat options - PIDOF="pgrep" - STATFMT="-f" - STATBYTES="%z" - STATPERMS="%A" + # Only proceed if we successfully located PkgDir + if [ -n "$PkgDir" ]; then + # Where is the software + PLEX_SQLITE="${PkgDir}/Contents/MacOS/Plex SQLite" + AppSuppDir="$HOME/Library/Application Support" + DBDIR="$AppSuppDir/Plex Media Server/Plug-in Support/Databases" + CACHEDIR="$HOME/Library/Caches/PlexMediaServer/PhotoTranscoder" + LOGFILE="$DBDIR/DBRepair.log" + LOG_TOOL="logger" + TMPDIR="/tmp" + SYSTMP="$TMPDIR" - # Root not required on MacOS. PMS runs as username. - RootRequired=0 + # MacOS uses pgrep and uses different stat options + PIDOF="pgrep" + STATFMT="-f" + STATBYTES="%z" + STATPERMS="%A" - # You can set haptic to 0 for silence. - HaveStartStop=1 - StartCommand=startMacPMS - StopCommand=stopMacPMS - HapticOkay=1 + # Root not required on MacOS. PMS runs as username. + RootRequired=0 - HostType="Mac" - return 0 + # You can set haptic to 0 for silence. + HaveStartStop=1 + StartCommand=startMacPMS + StopCommand=stopMacPMS + HapticOkay=1 + + HostType="Mac" + return 0 + fi # FreeBSD 14+ elif [ -e /etc/os-release ] && [ "$(cat /etc/os-release | grep FreeBSD)" != "" ]; then diff --git a/README.md b/README.md index 99aa9e7..4babe55 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![Download total](https://img.shields.io/github/downloads/ChuckPa/DBRepair/total.svg)](https://github.com/ChuckPa/DBRepair/releases) [![master](https://img.shields.io/badge/master-stable-green.svg?maxAge=2592000)]('') ![Maintenance](https://img.shields.io/badge/Maintained-Yes-green.svg) +[![Sponsor ChuckPa](https://img.shields.io/badge/Sponsor-%E2%9D%A4-ea4aaa.svg?style=flat&logo=github)](https://github.com/sponsors/ChuckPa) DBRepair is run from a command line (terminal or ssh/putty session) which has sufficient privilege to read/write the databases (minimum). diff --git a/ReleaseNotes b/ReleaseNotes index 7c9c847..99df3e0 100644 --- a/ReleaseNotes +++ b/ReleaseNotes @@ -7,7 +7,14 @@ [![master](https://img.shields.io/badge/master-stable-green.svg?maxAge=2592000)]('') ![Maintenance](https://img.shields.io/badge/Maintained-Yes-green.svg) + + # Release Info: +v1.16.00 + + 1. MacOS App Dir - Older MacOS systems use /Applications. Newer MacOS systems use $HOME/Applications. + DBRepair now detects this and supports both locations. + v1.15.00 1. DSM 6 Start/Stop - Change how DSM 6 start/stop feature implemented