Created
February 12, 2019 20:25
-
-
Save pdelteil/7bb0ac68e2e35da797d38e584669215b to your computer and use it in GitHub Desktop.
Script to open urls within a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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