kuldietercastel Mar 2nd, 2013 30 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # hostsToTxt.sh
- # Converts the available-host-site to a text file.
- # Description:
- # This script gets the file with the available hosts with wget and places it in the directory ~/wgetted.
- # Next it converts the html to a txt file and places it in ~/toSend/.
- # WARNING: Changing the directory or file names is not a good idea if you use this script in combination with the retrieveHosts.sh script.
- # Version: 1.0
- # Author: Dieter Castel
- # License: Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
- # See: http://creativecommons.org/licenses/by-nc-sa/3.0/ for more info.
- # Makes directories if needed and removes the old files.
- mkdir ~/wgetted
- rm -f ~/wgetted/hosts.html
- mkdir ~/toSend
- rm -f ~/toSend/hosts.txt
- # Retrieves the file as html
- # -v for verbose
- # -F for certainly using html
- # -N for using timestamping
- # --no-use-server-timestamps for using the local time
- wget -v -F -N --no-use-server-timestamps http://mysql.cs.kotnet.kuleuven.be/ -O ~/wgetted/hosts.html
- # Convert the html file to a text file and place it in the toSend directory.
- html2text ~/wgetted/hosts.html > ~/toSend/hosts.txt
RAW Paste Data