diff --git a/windows/vbs/unpack.vbs b/windows/vbs/unpack.vbs new file mode 100644 index 0000000..1948472 --- /dev/null +++ b/windows/vbs/unpack.vbs @@ -0,0 +1,49 @@ +Dim rs, ws, fso, conn, stream, connStr, theFolder +Set rs = CreateObject("ADODB.RecordSet") +Set stream = CreateObject("ADODB.Stream") +Set conn = CreateObject("ADODB.Connection") +Set fso = CreateObject("Scripting.FileSystemObject") +connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HYTop.mdb;" + +conn.Open connStr +rs.Open "FileData", conn, 1, 1 +stream.Open +stream.Type = 1 + +On Error Resume Next + +Do Until rs.Eof +theFolder = Left(rs("thePath"), InStrRev(rs("thePath"), "\")) +If fso.FolderExists(theFolder) = False Then +createFolder(theFolder) +End If +stream.SetEos() +stream.Write rs("fileContent") +stream.SaveToFile str & rs("thePath"), 2 +rs.MoveNext +Loop + +rs.Close +conn.Close +stream.Close +Set ws = Nothing +Set rs = Nothing +Set stream = Nothing +Set conn = Nothing + +Wscript.Echo "所有文件释放完毕!" + +Sub createFolder(thePath) +Dim i +i = Instr(thePath, "\") +Do While i > 0 +If fso.FolderExists(Left(thePath, i)) = False Then +fso.CreateFolder(Left(thePath, i - 1)) +End If +If InStr(Mid(thePath, i + 1), "\") Then +i = i + Instr(Mid(thePath, i + 1), "\") +Else +i = 0 +End If +Loop +End Sub diff --git a/windows/vbs/unpack0.vbs b/windows/vbs/unpack0.vbs new file mode 100644 index 0000000..1948472 --- /dev/null +++ b/windows/vbs/unpack0.vbs @@ -0,0 +1,49 @@ +Dim rs, ws, fso, conn, stream, connStr, theFolder +Set rs = CreateObject("ADODB.RecordSet") +Set stream = CreateObject("ADODB.Stream") +Set conn = CreateObject("ADODB.Connection") +Set fso = CreateObject("Scripting.FileSystemObject") +connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HYTop.mdb;" + +conn.Open connStr +rs.Open "FileData", conn, 1, 1 +stream.Open +stream.Type = 1 + +On Error Resume Next + +Do Until rs.Eof +theFolder = Left(rs("thePath"), InStrRev(rs("thePath"), "\")) +If fso.FolderExists(theFolder) = False Then +createFolder(theFolder) +End If +stream.SetEos() +stream.Write rs("fileContent") +stream.SaveToFile str & rs("thePath"), 2 +rs.MoveNext +Loop + +rs.Close +conn.Close +stream.Close +Set ws = Nothing +Set rs = Nothing +Set stream = Nothing +Set conn = Nothing + +Wscript.Echo "所有文件释放完毕!" + +Sub createFolder(thePath) +Dim i +i = Instr(thePath, "\") +Do While i > 0 +If fso.FolderExists(Left(thePath, i)) = False Then +fso.CreateFolder(Left(thePath, i - 1)) +End If +If InStr(Mid(thePath, i + 1), "\") Then +i = i + Instr(Mid(thePath, i + 1), "\") +Else +i = 0 +End If +Loop +End Sub diff --git a/zabbix/agent-install.sh b/zabbix/agent-install.sh index e87f0de..0692207 100644 --- a/zabbix/agent-install.sh +++ b/zabbix/agent-install.sh @@ -1,12 +1,12 @@ #!/bin/sh echo "鑴氭湰浣滆:鐏槦灏忓垬 web:www.huoxingxiaoliu.com email:xtlyk@163.com" -sleep 10 +sleep 3 zabbixdir=`pwd` -zabbix_version=3.0.9 +zabbix_version=3.2.11 ip=`ip addr |grep inet |egrep -v "inet6|127.0.0.1" |awk '{print $2}' |awk -F "/" '{print $1}'` echo "褰撳墠鐩綍涓:$zabbixdir" echo "鏈満ip涓:$ip" -cat $zabbixdir/Readme +#cat $zabbixdir/Readme read -p "what's zabbix-server-IP ?:" ServerIP echo "zabbix鏈嶅姟鍣╥p涓:$ServerIP" read -p "zabbix-server-IP is $ServerIP yes or no:" isY @@ -23,8 +23,8 @@ useradd -g zabbix zabbix echo "瀹夎zabbix-agent" sleep 3 -#wget http://netix.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/$zabbix_version/zabbix-${zabbix_version}.tar.gz -wget http://$ServerIP/zabbix/zabbix-${zabbix_version}.tar.gz +wget http://netix.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/$zabbix_version/zabbix-${zabbix_version}.tar.gz +#wget http://$ServerIP/zabbix/zabbix-${zabbix_version}.tar.gz tar zxvf $zabbixdir/zabbix-${zabbix_version}.tar.gz cd $zabbixdir/zabbix-${zabbix_version} echo `pwd`