/*
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Peter Hofer <ph@desktopbsd.net>
 *			(C) 2004, 2005
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#include "hostname.h"

#include <qstring.h>

#include <rcconf.h>
#include <sysctl.h>


/** Sets this system's hostname.
  * @return TRUE on success, otherwise FALSE.
  */
bool Hostname::set(const QString &  hostname) {
	return	(SysCtl::setStrCtl("kern.hostname", hostname)
				 && RCConf::setVar("hostname", hostname));
}

/** @return This system's hostname. */
QString Hostname::get() {
	return	SysCtl::getStrCtl("kern.hostname");
}
