Example #1
0
def reset_sambo():
    print 'input sambo passwd..\n'
    s, o = getso("smbpasswd -a %s" % HOST_NAME)
    handle(s, o)
    print 'reset samba server...'
    s, o = getso("service smbd restart")
    handle(s, o)
Example #2
0
def reset_sambo():
    print 'input sambo passwd..\n'
    s,o = getso("smbpasswd -a %s" %HOST_NAME)
    handle(s,o)
    print 'reset samba server...'
    s,o = getso("service smbd restart")
    handle(s,o)
Example #3
0
def install_netdriver():
    if  NET_DRIVER_NAME != '': 
        print 'intall NET Driver...\n'
        s,o = getso("cd %s && make clean && make install && modprobe %s  " %(NET_DRIVER_PATH,NET_DRIVER_NAME))
        handle(s,o)
    
    s,o = getso("ifconfig eth0 %s " %IP_ADDRESS)
    handle(s,o)
Example #4
0
def do():
    fd = open('/etc/apt/apt.conf','w')
    fd.write('%s' %NET_AGENCY)
    fd.close()

    s,o = getso("apt-get update")

    handle(s,o)

    s,o = getso("apt-get upgrade -y")

    handle(s,o)
Example #5
0
def do():
    fd = open('/etc/apt/apt.conf', 'w')
    fd.write('%s' % NET_AGENCY)
    fd.close()

    s, o = getso("apt-get update")

    handle(s, o)

    s, o = getso("apt-get upgrade -y")

    handle(s, o)
Example #6
0
def do():
    fd = open("package.txt")
    files = fd.readlines()
    fd.close()

    cmd = "apt-get install -y "

    for p in files:
        p = p.strip()
        if p:
            fd = open(PBASE + '/' + p)
            packages = fd.readlines()
            fd.close()
            for package in packages:
                    cmd = cmd + package.strip() + ' '
        else:
            continue

    from commands import getstatusoutput as getso

    s,o = getso(cmd)

    from handle_error import handle
    handle(s,o)
Example #7
0
def do():
    fd = open("package.txt")
    files = fd.readlines()
    fd.close()

    cmd = "apt-get install -y "

    for p in files:
        p = p.strip()
        if p:
            fd = open(PBASE + '/' + p)
            packages = fd.readlines()
            fd.close()
            for package in packages:
                cmd = cmd + package.strip() + ' '
        else:
            continue

    from commands import getstatusoutput as getso

    s, o = getso(cmd)

    from handle_error import handle
    handle(s, o)
Example #8
0
def reset_tftp():
    print 'reset tftp server...\n'
    s,o = getso("/etc/init.d/xinetd reload")
    handle(s,o)
    s,o = getso("service xinetd restart")
    handle(s,o)
Example #9
0
def reset_nfs():
    print 'reset nfs server...\n'
    s,o = getso("exportfs -rv")
    handle(s,o)
    s,o = getso("service nfs restart")
    handle(s,o)
Example #10
0
def generate_sshkey():
    print 'configure ssh-key password...\n'
    s,o = getso("ssh-keygen -t dsa -C %s -f ~/.ssh/%s"  %(EMAIL,EMAIL))
    handle(s,o)
Example #11
0
def clone_config():
    s,o = getso("cp -rf %s/* %s" % (ENV_URL, BASE))
    handle(s,o)
Example #12
0
def reset_tftp():
    print 'reset tftp server...\n'
    s, o = getso("/etc/init.d/xinetd reload")
    handle(s, o)
    s, o = getso("service xinetd restart")
    handle(s, o)
Example #13
0
def reset_nfs():
    print 'reset nfs server...\n'
    s, o = getso("exportfs -rv")
    handle(s, o)
    s, o = getso("service nfs-kernel-server restart")
    handle(s, o)
Example #14
0
def clone_config():
    s,o = getso("git clone %s %s" % (ENV_URL, BASE))
    handle(s,o)
Example #15
0
def generate_sshkey():
    print 'configure ssh-key...\n'
    s, o = getso("ssh-keygen -t dsa -C %s -f ~/.ssh/%s" % (EMAIL, EMAIL))
    handle(s, o)
Example #16
0
def clone_config():
    s, o = getso("cp -rf %s/* %s" % (ENV_URL, BASE))
    handle(s, o)