Plex Media Server on Synology Main Menu Shortcut Pointing to Wrong IP work-a-round

Written by James McDonald

June 1, 2015

I had an issue where clicking on the plex shortcut would take me to an old IP address.

The cause was that I had configured the LAN1 connection with 10.0.0.68 (eth0) and then moved home and plugged the DS415+ in using the LAN2 (eth1) interface.

The Plex cgi that returns the interface address returns the eth0 address (assuming that we always plug in LAN1)

My work-a-round is to add a query to check which link is in an up state to the “/var/packages/Plex Media Server/target/dsm_config/plex/plex.cgi” file. Here is my version:

Note: Every time Plex updates it will overwrite the change.

#!/bin/sh                                                                                                                                                                                                   
if [ `ifconfig | grep bond0 | awk '{print $1}'` ]                                                                                                                                                           
then                                                                                                                                                                                                        
IP_ADDR=`ifconfig bond0 | grep "inet addr" | awk '{print $2}' | awk -F: '{print $2}'`                                                                                                                       
else                                                                                                                                                                                                        
# add this                                                                                                                                                                                                  
ETH=`ip link | grep eth[[:digit:]]: | grep "state UP" | awk '{ print $2 }' | sed s/://g`                                                                                                                    
# change eth0 to $ETH                                                                                                                                                                                       
IP_ADDR=`ifconfig $ETH | grep "inet addr" | awk '{print $2}' | awk -F: '{print $2}'`                                                                                                                        
fi                                                                                                                                                                                                          
echo Location: http://${IP_ADDR}:32400/web                                                                                                                                                                  
echo ""                                                                                                                                                                                                     
exit 0 

.

plex_synology_shortcut

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…