teleport/dist/server/daemon/start.sh.in

53 lines
1.1 KiB
Bash
Raw Normal View History

2017-01-20 16:43:02 +00:00
#!/bin/bash
SRV=all
if [ x$1 != x ]; then
SRV=$1
fi
2017-03-26 16:24:23 +00:00
DAEMON_PATH={daemon_path}
shell_ret=0
2017-01-20 16:43:02 +00:00
2017-03-26 16:24:23 +00:00
cd "$DAEMON_PATH"
2017-01-20 16:43:02 +00:00
if [ $SRV == all ] || [ $SRV == web ] ; then
echo -n "starting teleport web ... "
result=$( ps ax | grep "$DAEMON_PATH/bin/tp_web start" | grep -v grep | wc -l )
2017-01-20 16:43:02 +00:00
if [ $result -gt 0 ]; then
echo "already running, skip."
else
$DAEMON_PATH/bin/tp_web start
sleep 5s
2017-01-20 16:43:02 +00:00
result=$( ps ax | grep "$DAEMON_PATH/bin/tp_web start" | grep -v grep | wc -l )
2017-01-20 16:43:02 +00:00
if [ ! $result -gt 0 ]; then
echo -e "\e[31m[FAILED]\033[0m"
2017-03-26 16:24:23 +00:00
shell_ret=1
2017-01-20 16:43:02 +00:00
else
echo -e "\e[32m[done]\033[0m"
fi
fi
fi
if [ $SRV == all ] || [ $SRV == core ] ; then
echo -n "starting teleport core server ... "
result=$( ps ax | grep "$DAEMON_PATH/bin/tp_core start" | grep -v grep | wc -l )
2017-01-20 16:43:02 +00:00
if [ $result -gt 0 ]; then
echo "already running, skip."
else
$DAEMON_PATH/bin/tp_core start
2017-01-20 16:43:02 +00:00
result=$( ps ax | grep "$DAEMON_PATH/bin/tp_core start" | grep -v grep | wc -l )
2017-01-20 16:43:02 +00:00
if [ ! $result -gt 0 ]; then
echo -e "\e[31m[FAILED]\033[0m"
2017-03-26 16:24:23 +00:00
shell_ret=1
2017-01-20 16:43:02 +00:00
else
echo -e "\e[32m[done]\033[0m"
fi
fi
fi
2017-03-26 16:24:23 +00:00
exit $shell_ret