-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_present_server.sh
More file actions
43 lines (32 loc) · 1.36 KB
/
run_present_server.sh
File metadata and controls
43 lines (32 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
app_path="$( cd "$(dirname ${BASH_SOURCE})" ; pwd -P )"
app_name="Head_pose"
. ${app_path}/script/func_util.sh
function main()
{
stop_pid=`ps -ef | grep "presenter_server\.py" | grep "${app_name}" | awk -F ' ' '{print $2}'`
if [[ ${stop_pid}"X" != "X" ]];then
echo -e "\033[33mNow do presenter server configuration, kill existing presenter process: kill -9 ${stop_pid}.\033[0m"
kill -9 ${stop_pid}
fi
check_python3_lib
if [ $? -ne 0 ];then
return 1
fi
#get and check format of remost_host ip
check_remote_host
if [ $? -ne 0 ];then
return 1
fi
parse_presenter_altasdk_ip ${remote_host}
parse_presenter_view_ip
#1.检查完毕ip之后,将ip的数值复制到config.config
echo "Use ${presenter_atlasdk_ip} to connect to Atlas DK Developerment Board..."
sed -i "s/presenter_server_ip=[0-9.]*/presenter_server_ip=${presenter_atlasdk_ip}/g" ${app_path}/presenterserver/Head_pose/config/config.conf
echo "Use ${presenter_view_ip} to show information in browser..."
sed -i "s/web_server_ip=[0-9.]*/web_server_ip=${presenter_view_ip}/g" ${app_path}/presenterserver/Head_pose/config/config.conf
echo "Finish to prepare ${app_name} presenter server ip configuration."
python3 ${app_path}/presenterserver/presenter_server.py --app ${app_name} &
return 0
}
main