forked from nemke82/magento2gitpod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblackfire-run.sh
More file actions
25 lines (18 loc) · 1.56 KB
/
Copy pathblackfire-run.sh
File metadata and controls
25 lines (18 loc) · 1.56 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
#!/bin/bash
clear;
sudo apt update;
sudo apt install --only-upgrade blackfire-php;
sudo apt install --only-upgrade blackfire;
blackfire-agent --register
blackfire config
cat /etc/blackfire/agent | grep "client-id=" | sed 's/server-id/blackfire.client_id/' >> /etc/php/$(php -v | awk 'NR=1{print substr($2,1,3); exit}')/cli/conf.d/92-blackfire-config.ini
cat /etc/blackfire/agent | grep "client-token=" | sed 's/server-token/blackfire.client_token/' >> /etc/php/$(php -v | awk 'NR=1{print substr($2,1,3); exit}')/cli/conf.d/92-blackfire-config.ini
cat /etc/blackfire/agent | grep "server-id=" | sed 's/server-id/blackfire.server_id/' >> /etc/php/$(php -v | awk 'NR=1{print substr($2,1,3); exit}')/fpm/conf.d/92-blackfire-config.ini
cat /etc/blackfire/agent | grep "server-token=" | sed 's/server-token/blackfire.server_token/' >> /etc/php/$(php -v | awk 'NR=1{print substr($2,1,3); exit}')/fpm/conf.d/92-blackfire-config.ini
sed -i '/blackfire.agent_socket/d' /etc/php/$(php -v | awk 'NR=1{print substr($2,1,3); exit}')/fpm/conf.d/92-blackfire-config.ini
sed -i '/blackfire.agent_socket/d' /etc/php/$(php -v | awk 'NR=1{print substr($2,1,3); exit}')/cli/conf.d/92-blackfire-config.ini
echo "blackfire.agent_socket=unix:///tmp/agent.sock" >> /etc/php/$(php -v | awk 'NR=1{print substr($2,1,3); exit}')/fpm/conf.d/92-blackfire-config.ini
echo "blackfire.agent_socket=unix:///tmp/agent.sock" >> /etc/php/$(php -v | awk 'NR=1{print substr($2,1,3); exit}')/cli/conf.d/92-blackfire-config.ini
#restart php-fpm
sudo supervisorctl restart php-fpm
blackfire-agent --socket=unix:///tmp/agent.sock &