#!/bin/sh FILENAME=$(ls -1t /mnt/media/plexsync/plexdb* | head -1) if sqlite3 /config/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db ".restore $FILENAME"; then echo "$(date)"": preStart lifecycle restore of Plex database was successful." else echo "$(date)"": preStart lifecycle restore of Plex database has failed." fi