Files
dsfin-ansible/roles/smbclient/files/smb-session.sh
mpelle426 2ed3936e53 -updates to hosts
-changes to templates for scripts
2019-07-12 14:18:25 +01:00

19 lines
401 B
Bash

#! /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 //{{ hostvars[groups['samba-server'][0]].ansible_host }}/share -c "get $file" -A ~/.credentials
fi