Skip to content
Permalink
Browse files

update

  • Loading branch information...
ppabc committed Jan 28, 2018
1 parent 077ff07 commit 9407a8237a465f1721e59fffe8cc093359978be2
Showing with 103 additions and 5 deletions.
  1. +49 −0 windows/vbs/unpack.vbs
  2. +49 −0 windows/vbs/unpack0.vbs
  3. +5 −5 zabbix/agent-install.sh
@@ -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
@@ -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
@@ -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服务器ip为:$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`

0 comments on commit 9407a82

Please sign in to comment.
You can’t perform that action at this time.