#!/bin/bash USER=`id -u -n` MNT_PT="/media/${USER}/Transcend/Pictures" [ -d ${MNT_PT} ] || { MNT_PT="/u/pictures" [ -d ${MNT_PT} ] || { echo "Cannot locate mount point for images" exit 1 } } PMM="${MNT_PT}/MagicMirror" for orient in landscape portrait do MOD_DIR="${PMM}/${orient}/Artists" [ -d ${MOD_DIR} ] || continue cd ${MOD_DIR} for folder in * do if [ "${orient}" == "landscape" ] then updartist -l "$folder" else updartist "$folder" fi done done