Skip to content

Commit

Permalink
修改Docker启动脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
Dot-Liu committed Sep 27, 2023
1 parent 5954192 commit 49dec57
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions build/resources/start.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
#!/bin/bash

# 判断进程是否正在运行
isProcessRunning() {
pid=`ps ax | grep "$PROG_PATH/$PROG" | grep -v "grep" | awk '{print $1}'`
if [[ $pid != "" ]] ; then
echo "true"
return "$?"
else
echo "false"
return "$?"
fi
}

set -e

#Launch the gateway
if [[ $APINTO_DEBUG == "true" ]]; then
#Launch the gateway
./apinto start
echo "[$(date "+%Y-%m-%d %H:%M:%S")] Gateway Stop"
exit 0
fi

is_process_running=$(isProcessRunning)
if [[ "$is_process_running" = "true" ]] ; then
echo "[$(date "+%Y-%m-%d %H:%M:%S")] process still running, waiting..."
sleep 5s
fi

./apinto start
is_process_running=$(isProcessRunning)
if [[ "$is_process_running" = "true" ]] ; then
echo "[$(date "+%Y-%m-%d %H:%M:%S")] APINTO start Success!" >> a.out
tail -f a.out
echo "[$(date "+%Y-%m-%d %H:%M:%S")] Gateway Stop"
exit 0
else
echo "[$(date "+%Y-%m-%d %H:%M:%S")] APINTO start Failed!" >> a.out
fi


echo "APINTO start Success!" >> a.out
tail -f a.out

0 comments on commit 49dec57

Please sign in to comment.