Files
dsfin-ansible/roles/facebook/files/facebook.sh

23 lines
505 B
Bash

#!/bin/bash
# generate facebook traffic by loading random help url's
#launch browser on local display
function launch_browser {
DISPLAY=:0 /usr/bin/chromium-browser `shuf -n 1 /home/'{{ def_username }}'/Documents/facebook_url.list` &
}
#prevent race condition/memory exhaustion
if pgrep -f chrome >/dev/null
then
/usr/bin/killall chrome
else
for i in $(seq 13)
do
launch_browser
sleep 10
done
/usr/bin/killall chrome
rm /home/'{{ def_username }}'/.config/chromium/BrowserMetrics/*
fi