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
.
0 Comments