Zachary Kotlarek 14 лет назад
Родитель
Сommit
9646ec13bc
12 измененных файлов с 6 добавлено и 318 удалено
  1. 0 53
      plex-button
  2. 1 0
      plex-button
  3. 0 53
      plex-clean
  4. 1 0
      plex-clean
  5. 0 53
      plex-files
  6. 1 0
      plex-files
  7. 0 53
      plex-gui
  8. 0 53
      plex-playing
  9. 1 0
      plex-playing
  10. 1 0
      plex-resolution
  11. 0 53
      plex-update
  12. 1 0
      plex-update

+ 0 - 53
plex-button

@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Parameters
-USER="plex"
-PASS="bobola22"
-HOST="localhost"
-PORT="3000"
-
-# Figure out what we should do
-CMD="`basename "${0}" | sed 's%^plex\-%%' | tr a-z A-Z`"
-
-# Reduce typing
-CURL="curl --silent --get --user ${USER}:${PASS}"
-RPATH="/xbmcCmds/xbmcHttp"
-URL="http://${HOST}:${PORT}${RPATH}"
-OUTPUT=0
-
-# Pick a command
-if [ "${CMD}" == "UPDATE" ]; then
-	URL="${URL}/?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)"
-elif [ "${CMD}" == "CLEAN" ]; then
-	URL="${URL}?command=ExecBuiltIn&parameter=XBMC.CleanLibrary(video)"
-elif [ "${CMD}" == "FILES" ]; then
-	URL="${URL}?command=queryvideodatabase(SELECT%20path.strPath,%20files.strFilename%20FROM%20path%20JOIN%20files%20ON%20path.idPath%20=%20files.idPath%20JOIN%20episode%20ON%20files.idFile%20=%20episode.idFile)"
-	OUTPUT=1
-elif [ "${CMD}" == "BUTTON" ]; then
-	URL="${URL}?command=SendKey(${1})"
-elif [ "${CMD}" == "PLAYING" ]; then
-	URL="${URL}?command=GetCurrentlyPlaying"
-	OUTPUT=1
-elif [ "${CMD}" == "GUI" ]; then
-	URL="${URL}?command=GetGuiDescription"
-	OUTPUT=1
-else
-	echo "Unknown command: ${CMD}" 1>&2
-	exit 1
-fi
-
-# Bail if Plex is not running
-if ! ps awx -o comm= | grep -v 'Media Server' | grep -q 'MacOS/Plex'; then
-	if [ $OUTPUT -gt 0 ]; then
-		echo "Plex is not running" 1>&2
-		exit 1
-	fi
-	exit 0
-fi
-
-# Run the command
-if [ $OUTPUT -gt 0 ]; then
-	$CURL "${URL}"
-else
-	$CURL "${URL}" >/dev/null
-fi

+ 1 - 0
plex-button

@@ -0,0 +1 @@
+plex

+ 0 - 53
plex-clean

@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Parameters
-USER="plex"
-PASS="bobola22"
-HOST="localhost"
-PORT="3000"
-
-# Figure out what we should do
-CMD="`basename "${0}" | sed 's%^plex\-%%' | tr a-z A-Z`"
-
-# Reduce typing
-CURL="curl --silent --get --user ${USER}:${PASS}"
-RPATH="/xbmcCmds/xbmcHttp"
-URL="http://${HOST}:${PORT}${RPATH}"
-OUTPUT=0
-
-# Pick a command
-if [ "${CMD}" == "UPDATE" ]; then
-	URL="${URL}/?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)"
-elif [ "${CMD}" == "CLEAN" ]; then
-	URL="${URL}?command=ExecBuiltIn&parameter=XBMC.CleanLibrary(video)"
-elif [ "${CMD}" == "FILES" ]; then
-	URL="${URL}?command=queryvideodatabase(SELECT%20path.strPath,%20files.strFilename%20FROM%20path%20JOIN%20files%20ON%20path.idPath%20=%20files.idPath%20JOIN%20episode%20ON%20files.idFile%20=%20episode.idFile)"
-	OUTPUT=1
-elif [ "${CMD}" == "BUTTON" ]; then
-	URL="${URL}?command=SendKey(${1})"
-elif [ "${CMD}" == "PLAYING" ]; then
-	URL="${URL}?command=GetCurrentlyPlaying"
-	OUTPUT=1
-elif [ "${CMD}" == "GUI" ]; then
-	URL="${URL}?command=GetGuiDescription"
-	OUTPUT=1
-else
-	echo "Unknown command: ${CMD}" 1>&2
-	exit 1
-fi
-
-# Bail if Plex is not running
-if ! ps awx -o comm= | grep -v 'Media Server' | grep -q 'MacOS/Plex'; then
-	if [ $OUTPUT -gt 0 ]; then
-		echo "Plex is not running" 1>&2
-		exit 1
-	fi
-	exit 0
-fi
-
-# Run the command
-if [ $OUTPUT -gt 0 ]; then
-	$CURL "${URL}"
-else
-	$CURL "${URL}" >/dev/null
-fi

+ 1 - 0
plex-clean

@@ -0,0 +1 @@
+plex

+ 0 - 53
plex-files

@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Parameters
-USER="plex"
-PASS="bobola22"
-HOST="localhost"
-PORT="3000"
-
-# Figure out what we should do
-CMD="`basename "${0}" | sed 's%^plex\-%%' | tr a-z A-Z`"
-
-# Reduce typing
-CURL="curl --silent --get --user ${USER}:${PASS}"
-RPATH="/xbmcCmds/xbmcHttp"
-URL="http://${HOST}:${PORT}${RPATH}"
-OUTPUT=0
-
-# Pick a command
-if [ "${CMD}" == "UPDATE" ]; then
-	URL="${URL}/?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)"
-elif [ "${CMD}" == "CLEAN" ]; then
-	URL="${URL}?command=ExecBuiltIn&parameter=XBMC.CleanLibrary(video)"
-elif [ "${CMD}" == "FILES" ]; then
-	URL="${URL}?command=queryvideodatabase(SELECT%20path.strPath,%20files.strFilename%20FROM%20path%20JOIN%20files%20ON%20path.idPath%20=%20files.idPath%20JOIN%20episode%20ON%20files.idFile%20=%20episode.idFile)"
-	OUTPUT=1
-elif [ "${CMD}" == "BUTTON" ]; then
-	URL="${URL}?command=SendKey(${1})"
-elif [ "${CMD}" == "PLAYING" ]; then
-	URL="${URL}?command=GetCurrentlyPlaying"
-	OUTPUT=1
-elif [ "${CMD}" == "GUI" ]; then
-	URL="${URL}?command=GetGuiDescription"
-	OUTPUT=1
-else
-	echo "Unknown command: ${CMD}" 1>&2
-	exit 1
-fi
-
-# Bail if Plex is not running
-if ! ps awx -o comm= | grep -v 'Media Server' | grep -q 'MacOS/Plex'; then
-	if [ $OUTPUT -gt 0 ]; then
-		echo "Plex is not running" 1>&2
-		exit 1
-	fi
-	exit 0
-fi
-
-# Run the command
-if [ $OUTPUT -gt 0 ]; then
-	$CURL "${URL}"
-else
-	$CURL "${URL}" >/dev/null
-fi

+ 1 - 0
plex-files

@@ -0,0 +1 @@
+plex

+ 0 - 53
plex-gui

@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Parameters
-USER="plex"
-PASS="bobola22"
-HOST="localhost"
-PORT="3000"
-
-# Figure out what we should do
-CMD="`basename "${0}" | sed 's%^plex\-%%' | tr a-z A-Z`"
-
-# Reduce typing
-CURL="curl --silent --get --user ${USER}:${PASS}"
-RPATH="/xbmcCmds/xbmcHttp"
-URL="http://${HOST}:${PORT}${RPATH}"
-OUTPUT=0
-
-# Pick a command
-if [ "${CMD}" == "UPDATE" ]; then
-	URL="${URL}/?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)"
-elif [ "${CMD}" == "CLEAN" ]; then
-	URL="${URL}?command=ExecBuiltIn&parameter=XBMC.CleanLibrary(video)"
-elif [ "${CMD}" == "FILES" ]; then
-	URL="${URL}?command=queryvideodatabase(SELECT%20path.strPath,%20files.strFilename%20FROM%20path%20JOIN%20files%20ON%20path.idPath%20=%20files.idPath%20JOIN%20episode%20ON%20files.idFile%20=%20episode.idFile)"
-	OUTPUT=1
-elif [ "${CMD}" == "BUTTON" ]; then
-	URL="${URL}?command=SendKey(${1})"
-elif [ "${CMD}" == "PLAYING" ]; then
-	URL="${URL}?command=GetCurrentlyPlaying"
-	OUTPUT=1
-elif [ "${CMD}" == "GUI" ]; then
-	URL="${URL}?command=GetGuiDescription"
-	OUTPUT=1
-else
-	echo "Unknown command: ${CMD}" 1>&2
-	exit 1
-fi
-
-# Bail if Plex is not running
-if ! ps awx -o comm= | grep -v 'Media Server' | grep -q 'MacOS/Plex'; then
-	if [ $OUTPUT -gt 0 ]; then
-		echo "Plex is not running" 1>&2
-		exit 1
-	fi
-	exit 0
-fi
-
-# Run the command
-if [ $OUTPUT -gt 0 ]; then
-	$CURL "${URL}"
-else
-	$CURL "${URL}" >/dev/null
-fi

+ 0 - 53
plex-playing

@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Parameters
-USER="plex"
-PASS="bobola22"
-HOST="localhost"
-PORT="3000"
-
-# Figure out what we should do
-CMD="`basename "${0}" | sed 's%^plex\-%%' | tr a-z A-Z`"
-
-# Reduce typing
-CURL="curl --silent --get --user ${USER}:${PASS}"
-RPATH="/xbmcCmds/xbmcHttp"
-URL="http://${HOST}:${PORT}${RPATH}"
-OUTPUT=0
-
-# Pick a command
-if [ "${CMD}" == "UPDATE" ]; then
-	URL="${URL}/?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)"
-elif [ "${CMD}" == "CLEAN" ]; then
-	URL="${URL}?command=ExecBuiltIn&parameter=XBMC.CleanLibrary(video)"
-elif [ "${CMD}" == "FILES" ]; then
-	URL="${URL}?command=queryvideodatabase(SELECT%20path.strPath,%20files.strFilename%20FROM%20path%20JOIN%20files%20ON%20path.idPath%20=%20files.idPath%20JOIN%20episode%20ON%20files.idFile%20=%20episode.idFile)"
-	OUTPUT=1
-elif [ "${CMD}" == "BUTTON" ]; then
-	URL="${URL}?command=SendKey(${1})"
-elif [ "${CMD}" == "PLAYING" ]; then
-	URL="${URL}?command=GetCurrentlyPlaying"
-	OUTPUT=1
-elif [ "${CMD}" == "GUI" ]; then
-	URL="${URL}?command=GetGuiDescription"
-	OUTPUT=1
-else
-	echo "Unknown command: ${CMD}" 1>&2
-	exit 1
-fi
-
-# Bail if Plex is not running
-if ! ps awx -o comm= | grep -v 'Media Server' | grep -q 'MacOS/Plex'; then
-	if [ $OUTPUT -gt 0 ]; then
-		echo "Plex is not running" 1>&2
-		exit 1
-	fi
-	exit 0
-fi
-
-# Run the command
-if [ $OUTPUT -gt 0 ]; then
-	$CURL "${URL}"
-else
-	$CURL "${URL}" >/dev/null
-fi

+ 1 - 0
plex-playing

@@ -0,0 +1 @@
+plex

+ 1 - 0
plex-resolution

@@ -0,0 +1 @@
+plex

+ 0 - 53
plex-update

@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Parameters
-USER="plex"
-PASS="bobola22"
-HOST="localhost"
-PORT="3000"
-
-# Figure out what we should do
-CMD="`basename "${0}" | sed 's%^plex\-%%' | tr a-z A-Z`"
-
-# Reduce typing
-CURL="curl --silent --get --user ${USER}:${PASS}"
-RPATH="/xbmcCmds/xbmcHttp"
-URL="http://${HOST}:${PORT}${RPATH}"
-OUTPUT=0
-
-# Pick a command
-if [ "${CMD}" == "UPDATE" ]; then
-	URL="${URL}/?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)"
-elif [ "${CMD}" == "CLEAN" ]; then
-	URL="${URL}?command=ExecBuiltIn&parameter=XBMC.CleanLibrary(video)"
-elif [ "${CMD}" == "FILES" ]; then
-	URL="${URL}?command=queryvideodatabase(SELECT%20path.strPath,%20files.strFilename%20FROM%20path%20JOIN%20files%20ON%20path.idPath%20=%20files.idPath%20JOIN%20episode%20ON%20files.idFile%20=%20episode.idFile)"
-	OUTPUT=1
-elif [ "${CMD}" == "BUTTON" ]; then
-	URL="${URL}?command=SendKey(${1})"
-elif [ "${CMD}" == "PLAYING" ]; then
-	URL="${URL}?command=GetCurrentlyPlaying"
-	OUTPUT=1
-elif [ "${CMD}" == "GUI" ]; then
-	URL="${URL}?command=GetGuiDescription"
-	OUTPUT=1
-else
-	echo "Unknown command: ${CMD}" 1>&2
-	exit 1
-fi
-
-# Bail if Plex is not running
-if ! ps awx -o comm= | grep -v 'Media Server' | grep -q 'MacOS/Plex'; then
-	if [ $OUTPUT -gt 0 ]; then
-		echo "Plex is not running" 1>&2
-		exit 1
-	fi
-	exit 0
-fi
-
-# Run the command
-if [ $OUTPUT -gt 0 ]; then
-	$CURL "${URL}"
-else
-	$CURL "${URL}" >/dev/null
-fi

+ 1 - 0
plex-update

@@ -0,0 +1 @@
+plex