real belt and braches stuff here, trying to cover every possible base though, who cares if the script is a mile long, as long as the user doesn't end up with a borked system
#test if plex is installed and try re-pulling latest if not
dpkg -s plexmediaserver > /dev/null 2>&1 || \
(echo "for some reason the update has failed and plex doesn't seem to be installed, retrying a known version" && curl -o /tmp/plexmediaserver.deb -L "${PLEX_INSTALL}" && dpkg -i /tmp/plexmediaserver.deb)
#recopy config file in case update overwrites our copy
#recopy config file in case update overwrites our copy