source: lmd/trunk/fuentes/lmd-server.install/usr/sbin/ltsp-set-domain-search-ltsconf @ 3136

Last change on this file since 3136 was 3136, checked in by kbut, 3 years ago

add script to set search domain

  • Property svn:executable set to *
File size: 492 bytes
Line 
1#!/usr/bin/env python
2import xmlrpclib
3c = xmlrpclib.ServerProxy('https://localhost:9779')
4domain = c.get_variable('','VariablesManager','INTERNAL_DOMAIN')
5ltsfile = '/var/lib/tftpboot/ltsp/lts.conf'
6f = open(ltsfile,'r')
7lines = f.readlines()
8f.close()
9needle="SEARCH_DOMAIN"
10for x in lines:
11        if x.startswith(needle):
12                lines.remove(x)
13if domain != None:
14        domainvalue = needle + '="' + domain +'"\n'
15        lines.append(domainvalue)
16        f = open(ltsfile,'w')
17        for x in lines:
18                f.write(x)
19        f.close()
Note: See TracBrowser for help on using the repository browser.