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

52 lines
1.1 KiB
Bash

#!/bin/bash
SRV=all
if [ x$1 != x ]; then
SRV=$1
fi
DAEMON_PATH={daemon_path}
shell_ret=0
cd "$DAEMON_PATH"
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 )
if [ $result -gt 0 ]; then
echo "already running, skip."
else
$DAEMON_PATH/bin/tp_core start
result=$( ps ax | grep "$DAEMON_PATH/bin/tp_core start" | grep -v grep | wc -l )
if [ ! $result -gt 0 ]; then
echo -e "\e[31m[FAILED]\033[0m"
shell_ret=1
else
echo -e "\e[32m[done]\033[0m"
fi
fi
fi
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 )
if [ $result -gt 0 ]; then
echo "already running, skip."
else
$DAEMON_PATH/bin/tp_web start
result=$( ps ax | grep "$DAEMON_PATH/bin/tp_web start" | grep -v grep | wc -l )
if [ ! $result -gt 0 ]; then
echo -e "\e[31m[FAILED]\033[0m"
shell_ret=1
else
echo -e "\e[32m[done]\033[0m"
fi
fi
fi
exit $shell_ret