Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
ae51753e
Commit
ae51753e
authored
Feb 01, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加服务检测拉起脚本
parent
7d52d095
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
portal-manager/src/main/bin/check_server.sh
portal-manager/src/main/bin/check_server.sh
+28
-0
smart-gateway/src/main/bin/check_server.sh
smart-gateway/src/main/bin/check_server.sh
+28
-0
No files found.
portal-manager/src/main/bin/check_server.sh
0 → 100644
View file @
ae51753e
#!/bin/bash
PORT
=
"@profiles.server.port@"
PROJECT_NAME
=
"@project.artifactId@"
;
MAIN_CLASS
=
"
$PROJECT_NAME
-@project.version@.jar"
;
SHELL_NAME
=
$0
SHELL_LOG
=
"
${
SHELL_NAME
}
.log"
LOG_DATE
=
'date "+%Y-%m-%d"'
LOG_TIME
=
'date "+%H-%M-%S"'
CDATE
=
$(
date
"+%Y-%m-%d"
)
CTIME
=
$(
date
"+%H-%M-%S"
)
#写日志
writelog
()
{
LOGINFO
=
$1
echo
"
${
CDATE
}
${
CTIME
}
:
${
SHELL_NAME
}
:
${
LOGINFO
}
"
>>
${
SHELL_LOG
}
}
jcpid
=
`
ps
-ef
|
grep
-v
"grep"
|
grep
"
$MAIN_CLASS
"
|
grep
"app.port=
$PORT
"
|
sed
-n
'1P'
|
awk
'{print $2}'
`
if
[
$jcpid
]
;
then
writelog
"The
$PROJECT_NAME
start finished, PID is
$jcpid
"
exit
$SUCCESS
else
writelog
"start service..."
systemctl stop
${
PROJECT_NAME
}
&&
systemctl start
${
PROJECT_NAME
}
fi
smart-gateway/src/main/bin/check_server.sh
0 → 100644
View file @
ae51753e
#!/bin/bash
PORT
=
"@profiles.server.port@"
PROJECT_NAME
=
"@project.artifactId@"
;
MAIN_CLASS
=
"
$PROJECT_NAME
-@project.version@.jar"
;
SHELL_NAME
=
$0
SHELL_LOG
=
"
${
SHELL_NAME
}
.log"
LOG_DATE
=
'date "+%Y-%m-%d"'
LOG_TIME
=
'date "+%H-%M-%S"'
CDATE
=
$(
date
"+%Y-%m-%d"
)
CTIME
=
$(
date
"+%H-%M-%S"
)
#写日志
writelog
()
{
LOGINFO
=
$1
echo
"
${
CDATE
}
${
CTIME
}
:
${
SHELL_NAME
}
:
${
LOGINFO
}
"
>>
${
SHELL_LOG
}
}
jcpid
=
`
ps
-ef
|
grep
-v
"grep"
|
grep
"
$MAIN_CLASS
"
|
grep
"app.port=
$PORT
"
|
sed
-n
'1P'
|
awk
'{print $2}'
`
if
[
$jcpid
]
;
then
writelog
"The
$PROJECT_NAME
start finished, PID is
$jcpid
"
exit
$SUCCESS
else
writelog
"start service..."
systemctl stop
${
PROJECT_NAME
}
&&
systemctl start
${
PROJECT_NAME
}
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment