#!/bin/bash PFAD=$(dirname "$(readlink -f "$0")") function beenden { rm -f $COOKIEFILE rm -f landingpage.txt rm -f searchresults.txt umount /scripts/housofusenet/mount exit $1 } USERAGENT='User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0' COOKIEFILE="/tmp/hou-cookie.txt" curl -s -H "${USERAGENT}" 'https://house-of-usenet.com/member.php?action=login' --cookie-jar ${COOKIEFILE} -o ${PFAD}/landingpage.txt POSTKEY=$(grep -m 1 ' /dev/null if [ $? -eq 0 ] ; then echo "Nichts gefunden" continue fi grep "kürzer als erlaubt" ${PFAD}/searchresults.txt > /dev/null if [ $? -eq 0 ] ; then echo "Suchbegriff zu kurz" continue fi grep "showthread.php" ${PFAD}/searchresults.txt | grep "subject_old" | sed 's@showthread.php@https://house-of-usenet.com/showthread.php@g' > "${PFAD}/results/${FILM}.html" echo "##############################" >> "${PFAD}/results/${FILM}.html" echo "Filmtitel auf Festplatte: ${FILM}" >> "${PFAD}/results/${FILM}.html" echo "##############################" rm -f ${PFAD}/searchresults.txt sleep 60 done beenden 0