Skip to content

Instantly share code, notes, and snippets.

View TheFreshPrinceOfBel-Air's full-sized avatar

Prince TheFreshPrinceOfBel-Air

  • Bel-Air
View GitHub Profile
@blacktwin
blacktwin / create_wait_kill_all.py
Last active June 11, 2018 16:43
Receive session_key from PlexPy when paused. Use session_id to create sub-script to wait for X time then check if still paused. If paused kill.
'''
fetch function from https://gist.github.com/Hellowlol/ee47b6534410b1880e19
PlexPy > Settings > Notification Agents > Scripts > Bell icon:
[X] Notify on pause
PlexPy > Settings > Notification Agents > Scripts > Gear icon:
Playback Pause: create_wait_kill_all.py
PlexPy > Settings > Notifications > Script > Script Arguments:
{session_key}
@fwenzel
fwenzel / plex_restart.sh
Created April 26, 2012 03:17
Simple watchdog script to restart plex media server if it becomes unresponsive.
#!/bin/bash
# If plex is not running, don't do anything.
plex_running=`ps ax | grep "\./Plex Media Server" | awk '{ print $1 }' | wc -l`
if [ "$plex_running" -eq 1 ]; then
exit 0
fi
# Test Plex web interface. If it's dead, this'll time out in a few seconds.
curl -I -m 8 "http://localhost:32400/library/sections" > /dev/null 2>&1