Skip to content

Commit

Permalink
Use systemctl only if systemd is present else use the service wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Aug 18, 2021
1 parent 5137c78 commit 1cecc2c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/scripts/tools/blackfire.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ add_blackfire_darwin() {
blackfire_config() {
if [[ -n $BLACKFIRE_SERVER_ID ]] && [[ -n $BLACKFIRE_SERVER_TOKEN ]]; then
blackfire agent:config --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN"
[ "$os" = "Linux" ] && sudo systemctl start blackfire-agent
[ "$os" = "Darwin" ] && brew services start blackfire
if [ "$os" = "Linux" ]; then
if [ -d /run/systemd/system ]; then
sudo systemctl start blackfire-agent
else
sudo service blackfire-agent start
fi
elif [ "$os" = "Darwin" ]; then
brew services start blackfire
fi
fi
if [[ -n $BLACKFIRE_CLIENT_ID ]] && [[ -n $BLACKFIRE_CLIENT_TOKEN ]]; then
blackfire client:config --client-id="$BLACKFIRE_CLIENT_ID" --client-token="$BLACKFIRE_CLIENT_TOKEN"
Expand Down

0 comments on commit 1cecc2c

Please sign in to comment.