Hi,
I’m trying to find a way to restart Plex on a remote server without root access when the machine goes down for maintenance.
I cant code or know much about Linux. so I looked for scripts and only found this one https://gist.github.com/fwenzel/2495425, but it doesn’t work. I think it’s because I need root privileges
#!/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
if [ “$?” -ne “0” ]; then
/usr/sbin/service plexmediaserver restart
fi
OR, IS THERE a way to get informed straight away when the server doesn’t have access? And is there a way to restart the server manually with a html link or something similar? Like the ones used to refresh libraries and such?
At least this way, I could know as soon as it happens and if I’m not available have a browser link for my older users to just click and have it back working if I’m offline for long.
Thanks guys