mirror of
https://github.com/ChuckPa/PlexDBRepair.git
synced 2025-11-06 03:08:55 -05:00
commit
4f5b5abdc8
21
DBRepair.sh
21
DBRepair.sh
@ -575,7 +575,6 @@ HostConfig() {
|
|||||||
AppSuppDir="$HOME/Library/Application Support"
|
AppSuppDir="$HOME/Library/Application Support"
|
||||||
DBDIR="$AppSuppDir/Plex Media Server/Plug-in Support/Databases"
|
DBDIR="$AppSuppDir/Plex Media Server/Plug-in Support/Databases"
|
||||||
CACHEDIR="$HOME/Library/Caches/PlexMediaServer/PhotoTranscoder"
|
CACHEDIR="$HOME/Library/Caches/PlexMediaServer/PhotoTranscoder"
|
||||||
PID_FILE="$DBDIR/dbtmp/plexmediaserver.pid"
|
|
||||||
LOGFILE="$DBDIR/DBRepair.log"
|
LOGFILE="$DBDIR/DBRepair.log"
|
||||||
LOG_TOOL="logger"
|
LOG_TOOL="logger"
|
||||||
|
|
||||||
@ -588,15 +587,11 @@ HostConfig() {
|
|||||||
# Root not required on MacOS. PMS runs as username.
|
# Root not required on MacOS. PMS runs as username.
|
||||||
RootRequired=0
|
RootRequired=0
|
||||||
|
|
||||||
# make the TMP directory in advance to store plexmediaserver.pid
|
# You can set haptic to 0 for silence.
|
||||||
mkdir -p "$DBDIR/dbtmp"
|
HaveStartStop=1
|
||||||
|
StartCommand=startMacPMS
|
||||||
# Remove stale PID file if it exists
|
StopCommand=stopMacPMS
|
||||||
[ -f "$PID_FILE" ] && rm "$PID_FILE"
|
HapticOkay=1
|
||||||
|
|
||||||
# If PMS is running create plexmediaserver.pid
|
|
||||||
PIDVALUE=$($PIDOF "Plex Media Server")
|
|
||||||
[ $PIDVALUE ] && echo $PIDVALUE > "$PID_FILE"
|
|
||||||
|
|
||||||
HostType="Mac"
|
HostType="Mac"
|
||||||
return 0
|
return 0
|
||||||
@ -1545,6 +1540,12 @@ DoStop(){
|
|||||||
return $Result
|
return $Result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Mac Helper Functions
|
||||||
|
startMacPMS() { TMPDIR=/tmp osascript -e 'tell app "Plex Media Server" to launch'; sleep 2; IsRunning && sayStarted; }
|
||||||
|
stopMacPMS() { osascript -e 'tell app "Plex Media Server" to quit'; sleep 2; IsRunning || sayStopped; }
|
||||||
|
sayStarted() { [ $HapticOkay -eq 1 ] && osascript -e 'say "started"'; }
|
||||||
|
sayStopped() { [ $HapticOkay -eq 1 ] && osascript -e 'say "Its stopped"'; }
|
||||||
|
|
||||||
# Do command line switches
|
# Do command line switches
|
||||||
#DoOptions() {
|
#DoOptions() {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user