checkService.sh revert
This commit is contained in:
parent
d4badff4bf
commit
159cf27603
@ -71,7 +71,7 @@ function compare(){
|
|||||||
if [ ${oriSum} = ${desSum} ];then
|
if [ ${oriSum} = ${desSum} ];then
|
||||||
#journalctl -n 1000 -xe -t autoDeploy > ${workPath}/autoDeploy.log
|
#journalctl -n 1000 -xe -t autoDeploy > ${workPath}/autoDeploy.log
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
echo $oriSum > ${workPath}/${fileName}_md5.txt
|
echo $oriSum > ${workPath}/${fileName}_md5.txt
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -79,7 +79,7 @@ function compare(){
|
|||||||
|
|
||||||
function restart(){
|
function restart(){
|
||||||
sleep 4
|
sleep 4
|
||||||
#systemctl restart $serviceName
|
systemctl restart $serviceName
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "error: systemctl restart ${serviceName} failed!"
|
echo "error: systemctl restart ${serviceName} failed!"
|
||||||
sleep 3
|
sleep 3
|
||||||
@ -92,7 +92,7 @@ function restart(){
|
|||||||
echo ossInfoTempPath: $ossInfoTempPath
|
echo ossInfoTempPath: $ossInfoTempPath
|
||||||
echo ossInfoProjectPath: $ossInfoProjectPath
|
echo ossInfoProjectPath: $ossInfoProjectPath
|
||||||
rm -f ${ossInfoProjectPath}
|
rm -f ${ossInfoProjectPath}
|
||||||
cp ${ossInfoTempPath} ${projectPath}
|
cp ${ossInfoTempPath} ${projectPath}
|
||||||
cp ${workPath}/${fileName}_md5.txt ${projectPath}
|
cp ${workPath}/${fileName}_md5.txt ${projectPath}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ function main(){
|
|||||||
compare
|
compare
|
||||||
result=$?
|
result=$?
|
||||||
echo "result $result"
|
echo "result $result"
|
||||||
if [ $result = 0 ];then
|
if [ $result = 0 ];then
|
||||||
# uploadLog
|
# uploadLog
|
||||||
echo "local temp file ${fileName} is same with file in ${projectPath} ,no need to replace"
|
echo "local temp file ${fileName} is same with file in ${projectPath} ,no need to replace"
|
||||||
echo "ok: checkService done"
|
echo "ok: checkService done"
|
||||||
@ -111,7 +111,7 @@ function main(){
|
|||||||
exit 0
|
exit 0
|
||||||
elif [ $result = 1 ]; then
|
elif [ $result = 1 ]; then
|
||||||
echo "local temp file $fileName is different from ${projectPath}, will replace..."
|
echo "local temp file $fileName is different from ${projectPath}, will replace..."
|
||||||
else
|
else
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
restart
|
restart
|
||||||
@ -122,4 +122,4 @@ function main(){
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
Loading…
x
Reference in New Issue
Block a user