#! /bin/bash file=$(i=$RANDOM if [ $i -lt 20000 ]; then echo 'test_file_50M' elif [ $i -lt 29490 ]; then echo 'test_file_100M' elif [ $i -gt 31129 ]; then echo 'test_file_500M' else echo 'test_file_200M'; fi) cd ~/Documents/smb if pgrep -f test_file >/dev/null then exit 0 else smbclient //192.168.88.230/share -c "get $file" -A ~/.credentials fi