Skip to content

Commit

Permalink
Merge branch 'master' of github.com:aqzt/kjyw
Browse files Browse the repository at this point in the history
  • Loading branch information
ppabc committed Apr 11, 2018
2 parents a0c8bac + 9407a82 commit a70fd39
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 5 deletions.
49 changes: 49 additions & 0 deletions windows/vbs/unpack.vbs
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions windows/vbs/unpack0.vbs
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions zabbix/agent-install.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh
echo "脚本作者:火星小刘 web:www.huoxingxiaoliu.com email:[email protected]"
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
Expand All @@ -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`
Expand Down

0 comments on commit a70fd39

Please sign in to comment.