Removed HERE document usage in favour of arguments to script

Note: With this new approach, "localhost.localdomain" is no longer accepted by the script.