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