Added support for passing external config file in arguments; Added statefile - script will output master server status to it (online / offline); removed duplicated isset() check; code improvements