Plex Media Server shorcut

Plex package allows users to manage and playback their media collections to local or remote desktop/mobile running Plex media client through Synology DiskStation
Forum rules
Please note the Disclaimer before modifying your Synology Product.

Plex Media Server shorcut

Postby Vulcan » Sun Apr 22, 2012 2:51 am

Hello,

I installed the new Plex Media Server 3rd party application on my DS712+ but was having a problem with the shortcut not working. When I clicked it, it just went back to the main DiskStation 4.0 home page. After some searching I found the fix.

The Plex Media Server shortcut points to: https://My Diskstation IP Address:5001/webman/3rdparty/plex/plex.cgi
(I use https for my connections, your shorcut might point to http)

Actual file path: /usr/syno/synoman/webman/3rdparty/plex/plex.cgi

I found that the second line of my plex.cgi file was different than the one show here:
http://forums2.plexapp.com/index.php/user/47932-joad/page__tab__posts

Mine:
#!/bin/sh
if [ 'ifconfig |grep -q bond0' ]

Linked version:
#!/bin/sh
if ifconfig |grep -q bond0

Once I edited the file in vi, removing the brackets and the quotes, the shortcut started working.
It should be noted that I am using the 2 network connections on the DS712+ as an aggregated link or "Bond", so this bit of code may not appear in the plex.cgi of users with only 1 network connection.

Hope this helps in case anyone else is having the same issue.

P.S. If any guru's out there can clarify what brackets and quotes are used for in cgi scripts (for commenting out code maybe?), I would appreciate it.
Vulcan
I'm New!
I'm New!
 
Posts: 3
Joined: Thu Apr 12, 2012 7:34 pm

Re: Plex Media Server shorcut

Postby zainag » Sun Dec 16, 2012 8:31 am

Thanks for your help - I had no idea why it changed but your fix worked!
zainag
I'm New!
I'm New!
 
Posts: 8
Joined: Sat Sep 11, 2010 7:50 pm

Re: Plex Media Server shorcut

Postby zforum69 » Thu Jan 17, 2013 8:19 am

Vulcan wrote:Hope this helps in case anyone else is having the same issue.


Thanks for that, I had the same issue using a bonded connection on a DSM 412+.

It seems the bug was reported on 3 January 2013 https://plexapp.lighthouseapp.com/proje ... dia-server but has not yet been allocated. I even downloaded the latest package straight from Plex which was version 0.9.7.11.386, while the latest one from the Package Center was version 0.9.7.9.375, and it still had the bug.

The file in: /usr/syno/synoman/webman/3rdparty/plex only exists when Plex is running. The file is actually located in: /var/packages/Plex Media Server/target/dsm_config/plex so you need to edit the one in there if Plex is not running.

One other thing, I am no fan of vi, so I normally edit a file using an editor in Windows and then copy it back. THIS DOES NOT WORK. If you do that it it is like the file does not even exist and you get a Sorry, the page you are looking for is not found. message. You HAVE to use vi, luckily the edits are not too hard.

Note as per the bug report you only need to remove the square brackets and can leave the single quotes behind.

Z
zforum69
Beginner
Beginner
 
Posts: 21
Joined: Tue Dec 25, 2012 3:22 am

Re: Plex Media Server shorcut

Postby zforum69 » Mon Jan 21, 2013 2:32 am

Vulcan wrote:P.S. If any guru's out there can clarify what brackets and quotes are used for in cgi scripts (for commenting out code maybe?), I would appreciate it.


I'm no guru but I think I've worked out what it all means and why there is a problem.

Basically the Synology uses the ash shell in busybox. ash does not use square brackets so it will cause an unexpected operator error, forcing it down the else path. If you have a bonded interface it will not work as the is for unbonded interfaces, while for unbonded interfaces it will work despite the bug because the else command happens to be the correct command.

With regard to the back quote "`", that is for command substitution, so whatever is enclosed in the back quotes to executed first before the other commands. In this case there is no point in having it as there is only one command. This is why the command will execute in exactly the same way whether or not it is enclosed in back quotes.

Z
zforum69
Beginner
Beginner
 
Posts: 21
Joined: Tue Dec 25, 2012 3:22 am

Re: Plex Media Server shorcut

Postby Bitstorm » Tue Apr 16, 2013 3:26 am

Just found this thread, had the same problem with my DS412+/DSM 4.2/Plex 0.9.7.9.375

Your fix worked and saved me headaches. Thanks alot!
User avatar
Bitstorm
I'm New!
I'm New!
 
Posts: 3
Joined: Tue May 03, 2011 12:15 am

Re: Plex Media Server shorcut

Postby cul8rmom1 » Mon Jul 01, 2013 2:13 am

Your fix worked for me as well.
I am running DS1812+ with Dell PowerConnect 5424s with a Bond setup.

Have a good one.
cul8rmom1
Trainee
Trainee
 
Posts: 10
Joined: Fri May 10, 2013 1:36 am

Re: Plex Media Server shorcut

Postby cavrel » Sun Aug 25, 2013 2:44 pm

Thx. It was a little annoying before your fix.
cavrel
I'm New!
I'm New!
 
Posts: 3
Joined: Sat Jun 15, 2013 12:08 pm

Re: Plex Media Server shorcut

Postby rchurch7 » Wed Aug 28, 2013 9:55 pm

How did you change the permission on the file to be able to save the changes? I can't save the file because it is read only and I can't seem to change the permissions to give me write access.
rchurch7
I'm New!
I'm New!
 
Posts: 2
Joined: Wed Jul 03, 2013 3:03 am

Re: Plex Media Server shorcut

Postby zforum69 » Thu Aug 29, 2013 12:55 am

rchurch7 wrote:How did you change the permission on the file to be able to save the changes? I can't save the file because it is read only and I can't seem to change the permissions to give me write access.


I didn't have to do any of that. Just login as root and use vi to edit the file.

Can you describe the process you went through?

Z
zforum69
Beginner
Beginner
 
Posts: 21
Joined: Tue Dec 25, 2012 3:22 am

Re: Plex Media Server shorcut

Postby Gary_580 » Sun Sep 08, 2013 9:42 am

Tried this solution on my DS412+ with the current version from the plex site and I still can't get he plex manage site to come up
Gary_580
I'm New!
I'm New!
 
Posts: 4
Joined: Sun Sep 08, 2013 9:39 am

Re: Plex Media Server shorcut

Postby zforum69 » Sun Sep 08, 2013 9:26 pm

Gary_580 wrote:Tried this solution on my DS412+ with the current version from the plex site and I still can't get he plex manage site to come up


What version are you using? Can you post a screen shot of plex.cgi after you have opened it in vi so that we can have a look to see if you modified it correctly?

Z
zforum69
Beginner
Beginner
 
Posts: 21
Joined: Tue Dec 25, 2012 3:22 am

Re: Plex Media Server shorcut

Postby Gary_580 » Mon Sep 09, 2013 12:33 am

I've tired 9.8.6.175 from the plex site and 9.7.28.33 from the synology package centre

Not sure how to post a screenshot. IMG didn't ask for a file location but a copy and paste is below


#!/bin/sh
if ifconfig | grep -q bond0
then
IP_ADDR=`ifconfig bond0 | grep "inet addr" | awk '{print $2}' | awk -F: '{print $2}'`
else
IP_ADDR=`ifconfig eth0 | grep "inet addr" | awk '{print $2}' | awk -F: '{print $2}'`
fi
echo Location: http://${IP_ADDR}:32400/manage
echo ""
exit 0
Gary_580
I'm New!
I'm New!
 
Posts: 4
Joined: Sun Sep 08, 2013 9:39 am

Re: Plex Media Server shorcut

Postby zforum69 » Mon Sep 09, 2013 2:07 pm

Gary_580 wrote:I've tired 9.8.6.175 from the plex site and 9.7.28.33 from the synology package centre


I'm running 9.7.28.33 at the moment and my plex.cgi is exactly like yours.

All I can suggest is make sure Plex is NOT running, and then modify the plex.cgi file located in /var/packages/Plex Media Server/target/dsm_config/plex

Then try running plex again. Other than that I can't think of anything else.

Z
zforum69
Beginner
Beginner
 
Posts: 21
Joined: Tue Dec 25, 2012 3:22 am

Re: Plex Media Server shorcut

Postby zforum69 » Mon Sep 09, 2013 2:30 pm

Gary_580 wrote:I've tired 9.8.6.175 from the plex site and 9.7.28.33 from the synology package centre

Just upgraded to 9.8.6.175, made sure Plex was not running, edited the file by removing the square brackets and single quotes on the second line, restarted plex. Waited a couple of minutes, and the link works. Initially I did not wait long enough after I restarted Plex and the link did not work, because Plex was not ready. If you can get to it manually by typing the url directly http://your_ip_address:32400/web then the shortcut form DSM should work.

Z
zforum69
Beginner
Beginner
 
Posts: 21
Joined: Tue Dec 25, 2012 3:22 am

Re: Plex Media Server shorcut

Postby Gary_580 » Mon Sep 09, 2013 2:42 pm

I checked the plex.cgi in both locations and even though I only changed one of them both have changed.

I don't think this is the issue now as the browser does get pointed to http://192.168.0.17:32400/manage which is what plex.cgi appears to be trying to establish.

From the logs the only error i can see is regarding "ERROR - Exception 'tm unable to handle not-a-date-time value' reading release date. Unless of course in looking at the wrong logs
Gary_580
I'm New!
I'm New!
 
Posts: 4
Joined: Sun Sep 08, 2013 9:39 am

Next

Return to Plex

Who is online

Users browsing this forum: fordrm and 2 guests