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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
def clone_config(): s,o = getso("cp -rf %s/* %s" % (ENV_URL, BASE)) handle(s,o)
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)
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)
def clone_config(): s,o = getso("git clone %s %s" % (ENV_URL, BASE)) handle(s,o)
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)
def clone_config(): s, o = getso("cp -rf %s/* %s" % (ENV_URL, BASE)) handle(s, o)