Ver Fonte

This should be in integration

Zachary Kotlarek há 14 anos atrás
pai
commit
a817ffdd55
4 ficheiros alterados com 0 adições e 106 exclusões
  1. 0 47
      pms/PMSCheck.sh
  2. 0 12
      pms/PMSHelper.sh
  3. 0 24
      pms/com.uberzach.PMS.check.plist
  4. 0 23
      pms/com.uberzach.PMS.plist

+ 0 - 47
pms/PMSCheck.sh

@@ -1,47 +0,0 @@
-#!/bin/bash
-
-# Config
-CURL_TIMEOUT=2
-DATE_TIMEOUT=360
-PMS_URL="http://localhost:32400/"
-
-# Command-line config
-LOOP=-1
-if [ "${1}" ]; then
-	LOOP="${1}"
-fi
-
-# Run at least once, loop if requested
-while [ $LOOP -ne 0 ]; do
-	# State tracking
-	FAILED=1
-
-	# Ask for the last update time from Plex
-	UPDATE="`curl --silent --max-time "${CURL_TIMEOUT}" "${PMS_URL}" | \
-		grep 'updatedAt=' | sed 's%^.*updatedAt="\([0-9]*\)".*$%\1%'`"
-
-	# If Plex replied, check the update time
-	if [ -n "${UPDATE}" ]; then
-		DATE="`date '+%s'`"
-		DIFF=$(( $DATE - $UPDATE ));
-		if [ $DIFF -le $DATE_TIMEOUT ]; then
-			FAILED=0
-		fi
-	fi
-
-	# If Plex has failed kill it
-	if [ $FAILED -gt 0 ]; then
-		echo "PMS is non-responsive. Killing..." 1>&2
-		killall 'Plex Media Server'
-		if [ $LOOP -lt 1 ]; then
-			exit 1
-		fi
-	fi
-
-	# Sleep for the next loop or exit
-	if [ $LOOP -gt 0 ]; then
-		sleep $LOOP
-	else
-		exit 0
-	fi
-done

+ 0 - 12
pms/PMSHelper.sh

@@ -1,12 +0,0 @@
-#!/bin/bash
-
-killall 'Plex Media Server' >/dev/null 2>&1
-killall 'Plex Media Scanner' >/dev/null 2>&1
-sleep 1
-
-if ! ~/bin/video/isMediaMounted; then
-	sleep 5
-	exit 1
-fi
-
-exec '/Applications/Zach/Media/Plex Media Server.app/Contents/MacOS/Plex Media Server'

+ 0 - 24
pms/com.uberzach.PMS.check.plist

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>LimitLoadToHosts</key>
-	<array>
-		<string>beddy.uberzach.com</string>
-	</array>
-	<key>RunAtLoad</key>
-	<true/>
-	<key>Label</key>
-	<string>com.uberzach.PMS.check</string>
-	<key>KeepAlive</key>
-	<dict>
-		<key>NetworkState</key>
-		<true/>
-	</dict>
-	<key>ProgramArguments</key>
-	<array>
-		<string>/Users/tv/bin/video/pms/PMSCheck.sh</string>
-		<string>30</string>
-	</array>
-</dict>
-</plist>

+ 0 - 23
pms/com.uberzach.PMS.plist

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>LimitLoadToHosts</key>
-	<array>
-		<string>beddy.uberzach.com</string>
-	</array>
-	<key>RunAtLoad</key>
-	<true/>
-	<key>Label</key>
-	<string>com.uberzach.PMS</string>
-	<key>KeepAlive</key>
-	<dict>
-		<key>NetworkState</key>
-		<true/>
-	</dict>
-	<key>ProgramArguments</key>
-	<array>
-		<string>/Users/tv/bin/video/pms/PMSHelper.sh</string>
-	</array>
-</dict>
-</plist>