Rehaul the script. Adding support for HUP,config-file and custom user-agent