more comments
validate database arguments
get local hostname and rename $server to $remote_server