I don't know how much code you need to see but this chuck , when it is ran due to empty dir it keeps telling me
either like I modded it to be or using a case statement.
it is just suppose to if source is empty move everything in holding area back to storage. Works on Linux without a hitch, but I think FreeBSD has got ya's I'm not completely aware of.
Code:
empty 0
No summary specified.
it is just suppose to if source is empty move everything in holding area back to storage. Works on Linux without a hitch, but I think FreeBSD has got ya's I'm not completely aware of.
Code:
#source images directory
empty=$(find "$from" \( -type f -name "*.jpg" -o -type f -name "*.png" \) | wc -l)
echo "empty $empty"
#notify-send "Left" "$empty"
#check storage place if empty
#then move holding place back to storage place
#case $empty in
# 0)
if [ "$empty" == '0' ] ; then
holdingimg=$(find "$moveto" \( -type f -name "*.jpg" -o -type f -name "*.png" \) | wc -l)
if [[ $holdingimg -gt '0' ]] ; then
notify-send "empty::$empty Images moved to" "$holdingimg"
while read f
do
filename=${f##*/}
subdir=${f%/*}
subdir=${subdir##*/}
echo $subdir
to=$from/$subdir
mkdir -p "$to"
[[ -f $f ]] && { mv $f $to ; echo "$to/$filename" > "$HOME"/mhsetrootimagefile ; }
done < <(find "$moveto" \( -type f -iname "*.jpg" -o -type f -iname "*.png" \) )
elif [[ $holdingimg -le '0' ]] ; then
notify-send " no images to be found in $favimages
or
$holding
exiting ..."
exit
fi
#;;
fi
#1)
#img=$images/$(ls $images)
# ;;
#esac