/*
 * 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 "domainname.h"

#include <qstring.h>

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

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

/** @return Name of current YP/NIS domain. */
QString  Domainname::get() {
	return	SysCtl::getStrCtl("kern.domainname");
}
