update 0.1.5

This commit is contained in:
QAIU
2023-06-13 13:23:09 +08:00
parent 5d9b18ef41
commit c629525029
12 changed files with 108 additions and 105 deletions

View File

@@ -7,7 +7,8 @@ Wants=network-online.target
[Service]
Type=simple
# User=USER
ExecStart=/usr/bin/java -server -Xmx128m -jar /root/java/netdisk-fast-download/netdisk-fast-download-0.0.1.jar
# 注意修改为自己的路径
ExecStart=/usr/bin/java -server -Xmx128m -jar /root/java/netdisk-fast-download/netdisk-fast-download*.jar
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=always
StandOutput=syslog

View File

@@ -0,0 +1,27 @@
::
:: generate service xml file
::
@echo off
pushd %~dp0
set MY_DIR=%~dp0
set MY_DIR=%MY_DIR:~0,-1%
for /f "delims=X" %%i in ('dir /b %MY_DIR%\netdisk-fast-download-*.jar') do (
set LAUNCH_JAR=%MY_DIR%\%%i
)
(for /f "delims=" %%a in (nfd-service-template.xml) do (
set "str=%%a"
setlocal enabledelayedexpansion
set "str=!str:${dd}=%MY_DIR%!"
set "str=!str:${jar}=%LAUNCH_JAR%!"
echo,!str!
endlocal
))>"nfd-service.xml"
sc delete netdisk-fast-download
nfd-service install
sc start netdisk-fast-download
pause

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<service>
<id>netdisk-fast-download</id>
<name>netdisk-fast-download</name>
<description>netdisk fast download service</description>
<executable>java</executable>
<arguments>-jar ${jar} -server -Xmx128m </arguments>
<logpath>${dd}\logs</logpath>
<log mode="roll-by-time">
<pattern>yyyyMMdd</pattern>
</log>
</service>

BIN
bin/nfd-service.exe Normal file

Binary file not shown.

View File

@@ -1,5 +1,10 @@
@echo off && @chcp 65001 > nul
pushd %~dp0
set LIB_DIR=%~dp0
for /f "delims=X" %%i in ('dir /b %LIB_DIR%\netdisk-fast-download-*.jar') do set LAUNCH_JAR=%LIB_DIR%\%%i
for /f "delims=X" %%i in ('dir /b %LIB_DIR%\netdisk-fast-download-*.jar') do (
set LAUNCH_JAR=%LIB_DIR%%%i
)
"%JAVA_HOME%\bin\java.exe" -Xmx512M -Dfile.encoding=utf8 -jar %LAUNCH_JAR% %*
pause