diff --git a/bin/Corpration.sh b/bin/Corpration.sh deleted file mode 100644 index 155f279874902d79b56179626a405ad734aedf01..0000000000000000000000000000000000000000 --- a/bin/Corpration.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -stty intr undef -stty -echo -clear -Corp="Corpright 2013-2015 Cheung Kei-Chuen All Rights Reserved" -info(){ - printf "\033[?25l" - i=0 - while [ $i -le 96 ] - do - printf "_" - sleep 0.02 - let i++ - done - echo -e "\n" -} -show(){ - #printf "\033[12;96H" - printf "\033[0;98H" - i=0 - while [ $i -le 5 ] - do - printf "\b/" - sleep 0.05 - printf "\b-" - sleep 0.05 - printf "\b\\" - sleep 0.05 - printf "\b|" - sleep 0.05 - let i++ - done - printf "\b " - printf "\033[?25h" -} -info -show -printf "\033[?25l" -echo -en "\t"; -corpration(){ - echo -e "\n\t\t\t" - echo "Welcome to use CheungSSH Linux/Unix Automation Tools!"|awk 'END{a=length($0);i=1;printf "\n\n\t\t";while(i<=a){printf substr($0,i,1) "\a";i++;system("sleep 0.1")} ;"printf \n"}' - echo "Author: Cheung Kei-Chuen"|awk 'END{a=length($0);i=1;printf "\n\n\t\t";while(i<=a){printf substr($0,i,1) "\a";i++;system("sleep 0.1")} ;"printf \n"}' - echo "Jobs: China Mobile Internet Automation Deployment"|awk 'END{a=length($0);i=1;printf "\n\n\t\t";while(i<=a){printf substr($0,i,1) "\a";i++;system("sleep 0.1")} ;"printf \n"}' - echo "$Corp"|awk 'END{a=length($0);i=1;printf "\n\n\t\t";while(i<=a){printf substr($0,i,1) "\a";i++;system("sleep 0.1")} ;"printf \n"}' - echo "QQ: 2418731289"|awk 'END{a=length($0);i=1;printf "\n\n\t\t";while(i<=a){printf substr($0,i,1) "\a";i++;system("sleep 0.1")};printf "\n" }' - echo "Download: http://blog.chinaunix.net/uid-29295703-id-4663051.html"|awk 'END{a=length($0);i=1;printf "\n\n\t\t";while(i<=a){printf substr($0,i,1) "\a";i++;system("sleep 0.1")};printf "\n" }' -} -endline1(){ - i=0 - printf "\033[0;98H" - while [ $i -le 105 ] - do - printf "+_" - #printf "\033[2D" - printf "\033[3D" - let i++ - sleep 0.03 - done - printf "__" -} -endline1 -corpration -printf "\n\033[?25h\n" -stty intr ^c -stty echo diff --git a/bin/LogCollect.py b/bin/LogCollect.py deleted file mode 100644 index 821d5a0c55e8f54a3bfc38788ecf9befbc1f2200..0000000000000000000000000000000000000000 --- a/bin/LogCollect.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/python -#coding:utf-8 -import os,sys,random,paramiko,time -def LogCollect(ip,port,username,password,cmd,ListenTime,UseKey): - try: - outchar='' - errchar='' - ssh=paramiko.SSHClient() - if UseKey=='y': - KeyPath=os.path.expanduser('~/.ssh/id_rsa') - key=paramiko.RSAKey.from_private_key_file(KeyPath) - ssh.load_system_host_keys() - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) #使用这个,如果是第一次连接,就不会不会弹出(yes/no) 提示 - ssh.connect(ip,port,username,pkey=key) #paramiko用法 http://docs.paramiko.org/en/latest/api/client.html - else: - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - ssh.connect(ip,port,username,password) - - Timeout_i=1 - while Timeout_i<=int(ListenTime): - stdin,stdout,stderr=ssh.exec_command(cmd) - out=stdout.readlines() - error_out=stderr.readlines() - for o in out: - outchar+=o - for err in error_out: - errchar+=err - if errchar: - print "\033[1;31m-ERR %s Deployment Faild , Check deployment FlagFile error (%s)\033[0m\a" %(ip,errchar) - return False - if outchar=='DoneSucc': #shell的终端输出应该是 echo -n 'DoneSucc' - print "\033[1;32m+OK %s Deployment \033[0m" % (ip) - return True - #print "Wating %s (%d Sec) Deploeymenting..." %(ip,Timeout_i), - Timeout_i+=1 - time.sleep(1) - stdin,stdout,stderr=ssh.exec_command("""killall -9 tail 2&>/dev/null""") - - except Exception,e: - print "\033[1;31m-ERR %s\033[0m\a" % e - return False - - -if __name__ =='__main__': - #LogCollect(ip,port,username,passwd,cmd,Timeout) - LogCollect('127.0.0.1',22,'sshd','zaq1ZAQ!',"""grep 'a' /tmp/a -q && echo -n 'DoneSucc'""",10,'n') -