diff options
author | Britney Fransen <brfransen@gmail.com> | 2012-04-24 01:42:16 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2012-04-24 01:42:16 (GMT) |
commit | f2a0080df441e3d9e5f054fdf5c9b48abd218879 (patch) | |
tree | 21cb185f548833b66dd1dd53dce98aa1916bdbd5 /abs/core/LinHES-config/mv_network.py | |
parent | 51665a2b73e708c35d1f4e523f0ecf22eb544597 (diff) | |
parent | 92e482361cd083f3a38ae0f90acd65de33c7b01f (diff) | |
download | linhes_pkgbuild-f2a0080df441e3d9e5f054fdf5c9b48abd218879.zip linhes_pkgbuild-f2a0080df441e3d9e5f054fdf5c9b48abd218879.tar.gz linhes_pkgbuild-f2a0080df441e3d9e5f054fdf5c9b48abd218879.tar.bz2 |
Merge branch 'testing' of linhes.org:linhes_pkgbuild into testing
Diffstat (limited to 'abs/core/LinHES-config/mv_network.py')
-rwxr-xr-x | abs/core/LinHES-config/mv_network.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/abs/core/LinHES-config/mv_network.py b/abs/core/LinHES-config/mv_network.py index f25d4bc..aab1345 100755 --- a/abs/core/LinHES-config/mv_network.py +++ b/abs/core/LinHES-config/mv_network.py @@ -143,6 +143,13 @@ def kill_dhcp(basedir): def setup_nameserver(dns): logging.info(" Adding %s for DNS", dns) + lan="local" + cmd = '''grep -q %s /etc/resolv.conf''' %lan + status = mv_common.runcmd(cmd) + if not status == 0 : + cmd = ''' echo "search %s" >> /etc/resolv.conf ''' %lan + mv_common.runcmd(cmd) + cmd = '''grep -q %s /etc/resolv.conf''' %dns status = mv_common.runcmd(cmd) if not status == 0 : @@ -301,6 +308,15 @@ def setup_interface(netdev,systemconfig): logging.info(" Enabling DHCP support") cmd = ''' sed -i -e 's/^BOOTPROTO=.*$/BOOTPROTO=dhcp/g' %s/%s/options''' %(etcnetdir, netdev) mv_common.runcmd(cmd) + #add .local .lan + local="local" + cmd = '''grep -q %s /etc/resolv.conf.head''' %local + status = mv_common.runcmd(cmd) + if not status == 0 : + cmd = ''' echo "search %s" >> /etc/resolv.conf.head ''' %local + mv_common.runcmd(cmd) + + else: logging.info(" Using static ip address of %s",netinfo["ip"]) cmd = ''' sed -i -e 's/^BOOTPROTO=.*$/BOOTPROTO=static/g' %s/%s/options''' %(etcnetdir, netdev) @@ -384,6 +400,10 @@ def find_active(systemconfig,this_is_install): mv_common.remove_file("/etc/resolv.conf") cmd = ''' echo search lan > /etc/resolv.conf ''' mv_common.runcmd(cmd) + + cmd = ''' echo search local >> /etc/resolv.conf ''' + mv_common.runcmd(cmd) + cmd = ''' echo nameserver 127.0.0.1 >> /etc/resolv.conf ''' mv_common.runcmd(cmd) @@ -487,6 +507,9 @@ def setup_network (systemconfig,this_is_install): return False logging.info("____Start of network____") logging.info(" Setting up the network") + mv_common.pacinstall("nss-mdns") + mv_common.pacinstall("avahi") + setup_nsswitch() restartfe = hostname_change_check(systemconfig) setup_hostname(systemconfig) find_active(systemconfig,this_is_install) @@ -494,12 +517,18 @@ def setup_network (systemconfig,this_is_install): logging.info("__End of network\n") return restartfe +def setup_nsswitch(): + logging.info(" Adding mdns4 to nsswitch.conf") + cmd = '''sed -i "s/hosts:.*$/hosts: files mdns4_minimal dns mdns4/" /etc/nsswitch.conf''' + mv_common.runcmd(cmd) ##this is used by the install process to start the network def install_network_setup(systemconfig): logging.info("____Start of network_install____") logging.info(" Setting up the network") + + #setup_MYTH_vars setup_hostname(systemconfig) stop_network() |