Skip to content

Commit a7d37be

Browse files
committed
Update holer client
1 parent 78163ab commit a7d37be

File tree

9 files changed

+30
-27
lines changed

9 files changed

+30
-27
lines changed

Binary/Java/holer-client-v1.2.zip

27 KB
Binary file not shown.

SourceCode/Java/holer-client/src/main/resources/bin/startup.vbs renamed to SourceCode/Java/holer-client/src/main/resources/bin/holer.vbs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ Set HOLER_ENV = HOLER_WSH.Environment("USER")
3434

3535
JAVA_BIN = "javaw"
3636

37-
HOLER_HOME = HOLER_ENV("HOLER_HOME")
3837
HOLER_ACCESS_KEY = HOLER_ENV("HOLER_ACCESS_KEY")
3938
HOLER_SERVER_HOST = HOLER_ENV("HOLER_SERVER_HOST")
39+
HOLER_HOME = HOLER_ENV("HOLER_HOME")
4040

4141
If HOLER_HOME = Empty Then
4242
HOLER_HOME = HOLER_FSO.GetFolder("..\").Path & "\"
43-
HOLER_ENV("HOLER_HOME") = HOLER_HOME
4443
End If
4544

4645
HOLER_APP = HOLER_HOME & "holer-client.jar"
@@ -120,6 +119,6 @@ Function LaunchHoler()
120119
'---------------------------------------------------
121120
' Find holer daemon
122121
'---------------------------------------------------
123-
HOLER_CMD = "cmd.exe /c echo Starting holer client... & timeout /T 4 /NOBREAK & echo " & HOLER_LINE & " & echo The running holer client: & tasklist | findstr " & JAVA_BIN & " & echo " & HOLER_LINE & " & pause"
122+
HOLER_CMD = "cmd.exe /c echo Starting holer client... & timeout /T 3 /NOBREAK & echo " & HOLER_LINE & " & echo The running holer client: & tasklist | findstr " & JAVA_BIN & " & echo " & HOLER_LINE & " & pause"
124123
HOLER_WSH.Run HOLER_CMD, 1, True
125124
End Function

SourceCode/Java/holer-client/src/main/resources/bin/setup.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ cd `dirname $0`/..
2121

2222
HOLER_OK=0
2323
HOLER_ERR=1
24-
24+
HOLER_NAME="holer"
2525
HOLER_HOME=`pwd`
2626
HOLER_BIN=$HOLER_HOME/bin
27-
HOLER_CONF_DIR=$HOLER_HOME/conf
28-
HOLER_CONF=$HOLER_CONF_DIR/holer.conf
29-
HOLER_NAME="holer"
27+
HOLER_CONF=$HOLER_HOME/conf/holer.conf
3028
RC_INIT_DIR="/etc/rc.d/init.d"
3129

3230
function input()

SourceCode/Java/holer-client/src/main/resources/bin/setup.vbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Set HOLER_FSO = CreateObject("Scripting.FileSystemObject")
2929
Set HOLER_WSH = CreateObject("WScript.Shell")
3030
Set HOLER_ENV = HOLER_WSH.Environment("USER")
3131

32-
HOLER_VBS_FILE = "startup.vbs"
32+
HOLER_VBS_FILE = "holer.vbs"
3333
HOLER_BOOT_DIR = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\"
3434
HOLER_HOME = HOLER_FSO.GetFolder("..\").Path & "\"
3535
HOLER_CONF = HOLER_HOME & "conf\holer.conf"

SourceCode/Java/holer-client/src/main/resources/bin/startup.bat

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ set HOLER_OK=0
2424
set HOLER_ERR=1
2525
set JAVA_BIN=java
2626

27-
if "!HOLER_HOME!" equ "" (
28-
set HOLER_HOME=%~dp0\..
29-
)
30-
27+
set HOLER_HOME=%~dp0\..
3128
set HOLER_ARGS=-Dapp.home=!HOLER_HOME!
29+
set HOLER_CONF=!HOLER_HOME!\conf\holer.conf
3230
set HOLER_APP=!HOLER_HOME!\holer-client.jar
3331
set HOLER_LOG_DIR=!HOLER_HOME!\logs
3432
set HOLER_LOG=!HOLER_LOG_DIR!\holer-client.log
@@ -51,7 +49,12 @@ if !errorlevel! neq 0 (
5149
goto:eof
5250
)
5351

54-
@REM Asking for the HOLER_ACCESS_KEY
52+
@REM Set HOLER ENV
53+
if exist "!HOLER_CONF!" (
54+
for /f "usebackq eol=# delims== tokens=1,*" %%i in ("!HOLER_CONF!") do set %%i=%%j
55+
)
56+
57+
@REM Asking for the HOLER_ACCESS_KEY
5558
if "!HOLER_ACCESS_KEY!" equ "" (
5659
@echo !HOLER_LINE!
5760
set /p HOLER_ACCESS_KEY="Enter holer access key: "
@@ -61,9 +64,10 @@ if "!HOLER_ACCESS_KEY!" equ "" (
6164
pause
6265
exit /b !HOLER_ERR!
6366
)
67+
@echo HOLER_ACCESS_KEY=!HOLER_ACCESS_KEY!> !HOLER_CONF!
6468
)
6569

66-
@REM Asking for the HOLER_SERVER_HOST
70+
@REM Asking for the HOLER_SERVER_HOST
6771
if "!HOLER_SERVER_HOST!" equ "" (
6872
@echo !HOLER_LINE!
6973
set /p HOLER_SERVER_HOST="Enter holer server host: "
@@ -73,13 +77,14 @@ if "!HOLER_SERVER_HOST!" equ "" (
7377
pause
7478
exit /b !HOLER_ERR!
7579
)
80+
@echo HOLER_SERVER_HOST=!HOLER_SERVER_HOST!>> !HOLER_CONF!
7681
)
7782

7883
@echo !HOLER_LINE!
7984
@echo Starting holer client...
8085

8186
start /b !JAVA_BIN!w !HOLER_ARGS! -jar !HOLER_APP! >> !HOLER_LOG!
82-
timeout /T 4 /NOBREAK
87+
timeout /T 3 /NOBREAK
8388

8489
@echo !HOLER_LINE!
8590
tasklist | findstr !JAVA_BIN!w

SourceCode/Java/holer-client/src/main/resources/bin/startup.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ HOLER_ERR=1
2424
HOLER_PID=""
2525

2626
HOLER_HOME=`pwd`
27-
HOLER_CONF_DIR=$HOLER_HOME/conf
28-
HOLER_CONF=$HOLER_CONF_DIR/holer.conf
2927
HOLER_LOG_DIR=$HOLER_HOME/logs
3028
HOLER_LOG=$HOLER_LOG_DIR/holer-client.log
3129
HOLER_APP=$HOLER_HOME/holer-client.jar
30+
HOLER_CONF=$HOLER_HOME/conf/holer.conf
3231
HOLER_ARGS="-Dapp.home=$HOLER_HOME"
3332

3433
function pid()
@@ -48,6 +47,10 @@ function status()
4847

4948
function input()
5049
{
50+
if [ -f $HOLER_CONF ]; then
51+
. $HOLER_CONF
52+
fi
53+
5154
# Asking for the holer access key
5255
if [ "$HOLER_ACCESS_KEY" == "" ]; then
5356
echo "Enter holer access key:"
@@ -73,10 +76,6 @@ function input()
7376

7477
function start()
7578
{
76-
if [ -f $HOLER_CONF ]; then
77-
. $HOLER_CONF
78-
fi
79-
8079
if [ ! -d $HOLER_LOG_DIR ]; then
8180
mkdir -p $HOLER_LOG_DIR
8281
fi
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
HOLER_ACCESS_KEY=
2-
HOLER_SERVER_HOST=
1+
HOLER_ACCESS_KEY=HOLER_CLIENT-2F8D8B78B3C2A0AE
2+
HOLER_SERVER_HOST=www.holer.org
3+
HOLER_SERVER_PORT=6060

SourceCode/Java/holer-common/src/main/java/org/holer/common/util/HolerConfig.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ public void initConfig(String confFile)
9595

9696
public String strValue(String key)
9797
{
98-
return this.holerConf.getProperty(key);
98+
String value = this.holerConf.getProperty(key);
99+
return StringUtils.trim(value);
99100
}
100101

101102
public String strValue(String key, String defaultValue)
@@ -110,7 +111,7 @@ public String strValue(String key, String defaultValue)
110111

111112
public Integer intValue(String key)
112113
{
113-
String value = this.holerConf.getProperty(key);
114+
String value = this.strValue(key);
114115
if (StringUtils.isEmpty(value))
115116
{
116117
return null;
@@ -134,7 +135,7 @@ public int intValue(String key, int defaultValue)
134135

135136
public Boolean boolValue(String key)
136137
{
137-
String value = this.holerConf.getProperty(key);
138+
String value = this.strValue(key);
138139
if (StringUtils.isBlank(value))
139140
{
140141
return null;

SourceCode/Java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<dependency>
3333
<groupId>io.netty</groupId>
3434
<artifactId>netty-all</artifactId>
35-
<version>4.1.39.Final</version>
35+
<version>4.1.41.Final</version>
3636
</dependency>
3737
<dependency>
3838
<groupId>org.slf4j</groupId>

0 commit comments

Comments
 (0)