def load( forceTmp = False ): if os.getuid(): #ROOT user return (0) if subprocess.call([const.CONF_COPYTOTMP %(os.getuid(), os.getgid())], shell=True ): return(False) confFile = const.CONF_FILE_TMP elif forceTmp: confFile = const.CONF_FILE_TMP else: confFile = const.CONF_FILE data = conf() config = ConfigParser.SafeConfigParser() try: config.read([confFile]) subprocess.call(const.CONF_TMPREMOVE, shell=True) data.updelay = config.get("DINO", "updelay") data.uname = config.get("DNSOMATIC", "username") try: data.password = base64.b64decode(config.get("DNSOMATIC", "password")) except: data.password = "" data.host = config.get("DNSOMATIC", "hosts") except: return(False) return(data)
def getConfData(): return(conf())