Skip to content

Instantly share code, notes, and snippets.

@pdelteil
Created February 12, 2019 20:25
Show Gist options
  • Save pdelteil/7bb0ac68e2e35da797d38e584669215b to your computer and use it in GitHub Desktop.
Save pdelteil/7bb0ac68e2e35da797d38e584669215b to your computer and use it in GitHub Desktop.
Script to open urls within a file
cat openUrls.sh
if [[ $# -eq 0 ]] ; then
echo "Usage $0 fileWithUrls.txt"
exit 0
fi
PROGRAM="firefox"
INPUT=$1
if pgrep -x $PROGRAM > /dev/null
then
echo "$PROGRAM Running"
else
echo "$PROGRAM not running"
echo "starting..."
/etc/firefox/firefox-bin &
sleep 3
fi
while read line; do
echo "Loading $line"
/etc/firefox/firefox-bin --new-tab "$line"
done < $INPUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment