zoukankan      html  css  js  c++  java
  • 批量升级 CentOS bash

    #! /usr/bin/env python
    #coding=utf-8
     
    from fabric.api import *
    from fabric.state import *
     
    env.roledefs = {
        'scan_proc_server': [
                             '172.16.1.15',
                             '172.16.1.12',
                             '172.16.1.18',
                             '172.16.1.19',
                             '172.16.1.10',
                             '172.16.1.11',
                             '172.16.1.12',
                             '172.16.1.13',
                             '172.16.1.14',
                             '172.16.1.15',
                             '172.16.1.16',
                             '172.16.1.17',
                             '172.16.1.18',
                             '172.16.1.19',
                            # '172.16.1.14',
                             '172.16.1.101',
                             '172.16.1.102',
                             '172.16.1.103',
        ],
        'storage_server':[
            '172.16.1.100'
            ],
        'auto_server':[
            ],
    }
     
    env.user='root'
    env.password = '******'
     
     
    @roles('scan_proc_server')
    def task_scan_source():
        run('mkdir /dev/shm/chan/')
        put('./chan/', '/dev/shm/')
        with cd('/dev/shm/chan/'):
            run('python2.6 change_netmask.py')
     
    @roles('scan_proc_server')
    def update_bash():
        run('rpm -ivh http://172.16.1.250:60001/packages/bash-4.1.2-15.el6_5.2.x86_64.rpm --force')
        run("env x='() { :;}; echo vulnerable' bash -c "echo this is a test"")
     
     
    def dotask():
        execute(update_bash)
     
    if __name__ == '__main__'
        dotask()
  • 相关阅读:
    数组和矩阵问题
    Memcached安装以及PHP的调用
    php函数ob_start()、ob_end_clean()、ob_get_contents()
    Nginx
    电影大全 API接口
    找电影资源最强攻略,知道这些你就牛B了!
    CSS3 图片旋转
    curl网站开发指南
    Redis 集群方案
    从12大技巧、30个案例、99个模板谈怎么写标题
  • 原文地址:https://www.cnblogs.com/L-H-R-X-hehe/p/4025273.html
Copyright © 2011-2022 走看看