2023-09-08 11:31:55 +00:00
|
|
|
[tasks.start-client]
|
|
|
|
|
|
|
|
[tasks.stop-client]
|
|
|
|
condition = { env_set = ["CLIENT_PROCESS_NAME"] }
|
|
|
|
script = '''
|
2024-02-23 18:40:44 +00:00
|
|
|
if pidof -q ${CLIENT_PROCESS_NAME}; then
|
|
|
|
echo " Stopping ${CLIENT_PROCESS_NAME}"
|
2023-09-08 11:31:55 +00:00
|
|
|
pkill -ef ${CLIENT_PROCESS_NAME}
|
2024-02-23 18:40:44 +00:00
|
|
|
else
|
|
|
|
echo " ${CLIENT_PROCESS_NAME} is already stopped"
|
2023-09-08 11:31:55 +00:00
|
|
|
fi
|
|
|
|
'''
|
|
|
|
|
|
|
|
[tasks.client-status]
|
|
|
|
condition = { env_set = ["CLIENT_PROCESS_NAME"] }
|
|
|
|
script = '''
|
2024-02-23 18:40:44 +00:00
|
|
|
if pidof -q ${CLIENT_PROCESS_NAME}; then
|
2023-09-08 11:31:55 +00:00
|
|
|
echo " ${CLIENT_PROCESS_NAME} is up"
|
2024-02-23 18:40:44 +00:00
|
|
|
else
|
|
|
|
echo " ${CLIENT_PROCESS_NAME} is not running"
|
2023-09-08 11:31:55 +00:00
|
|
|
fi
|
|
|
|
'''
|
|
|
|
|
|
|
|
[tasks.maybe-start-client]
|
|
|
|
condition = { env_set = ["CLIENT_PROCESS_NAME"] }
|
|
|
|
script = '''
|
2024-02-23 18:40:44 +00:00
|
|
|
if pidof -q ${CLIENT_PROCESS_NAME}; then
|
|
|
|
echo " ${CLIENT_PROCESS_NAME} is already started"
|
|
|
|
else
|
2023-09-08 11:31:55 +00:00
|
|
|
echo " Starting ${CLIENT_PROCESS_NAME}"
|
2024-02-23 18:40:44 +00:00
|
|
|
if [ -n "${SPAWN_CLIENT_PROCESS}" ];then
|
|
|
|
echo "Spawning process..."
|
2023-09-18 00:38:03 +00:00
|
|
|
cargo make start-client ${@} &
|
|
|
|
else
|
|
|
|
cargo make start-client ${@}
|
|
|
|
fi
|
2023-09-08 11:31:55 +00:00
|
|
|
fi
|
|
|
|
'''
|