Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
Not necessary to have all cloud drives mounted, only plex paths
Browse files Browse the repository at this point in the history
  • Loading branch information
masonr committed Jun 29, 2017
1 parent 2abbeab commit 3570593
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
17 changes: 7 additions & 10 deletions plex-scan.sh
Expand Up @@ -27,16 +27,13 @@ if [ -s "$plexidrive_dir/plex-scan" ]
then

# Check mount paths are sucessfully mounted
for (( i=0; i<${num_of_gdrives}; i++ ));
do
out=`ls ${gdrive_mount_paths[i]}`
if [ -z "$out" ]
then
echo "A gdrive accounts is not mounted."
echo "$(date +%F_%T) plex-scan:${drive_names[i]} not mounted" >> "$plexidrive_dir/plex-scan.log"
exit 1 # exit the script
fi
done
if [ ! -d "$plex_tvshow_path" ] || [ ! -d "$plex_movies_path" ]
then
echo "At least one plex path is not mounted."
echo "$(date +%F_%T) plex-scan: at least one plex path is not mounted" >> "$plexidrive_dir/plex-scan.log"
echo "$(date +%F_%T) plex-scan: at least one plex path is not mounted" >> "$plexidrive_dir/upload-error"
exit 1 # exit the script
fi

unset n
while read -r line; do
Expand Down
1 change: 0 additions & 1 deletion plexidrive.conf
@@ -1,7 +1,6 @@
## Drive Settings ##
num_of_gdrives=1
drive_names=('')
gdrive_mount_paths=('')

## Options ##
delete_after_upload=true # true/false
Expand Down
6 changes: 3 additions & 3 deletions plexidrive.sh
Expand Up @@ -33,9 +33,9 @@ touch plex-scan.log
touch upload-error

# Check variables
if [ "$num_of_gdrives" -ne ${#drive_names[@]} ] || [ "$num_of_gdrives" -ne ${#gdrive_mount_paths[@]} ] ; then
echo "gdrive variables are not set up correctly! Exiting..."
echo "$(date +%F_%T) gdrive variables are not set up correctly! Exiting." >> "$plexidrive_dir/upload-error"
if [ "$num_of_gdrives" -ne ${#drive_names[@]} ] ; then
echo "Number of gdrives does not match the number of drive names! Exiting..."
echo "$(date +%F_%T) Number of gdrives does not match the number of drive names! Exiting." >> "$plexidrive_dir/upload-error"
exit 1
fi

Expand Down

0 comments on commit 3570593

Please sign in to comment.