Skip to content

Commit

Permalink
Woo many awk | that
Browse files Browse the repository at this point in the history
  • Loading branch information
bart88 committed Apr 4, 2018
1 parent 8b2055b commit c32e57d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dsh
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ setup_xdebug() {
HOST_IP=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p' | head -1)
notice "Configuring xdebug to connect to host at: ${HOST_IP}."
# Get the PHP VERSION, so we edit the correct ini file.
PHP_VERSION=$(php -v | head -n1 | awk '{print $2}' | awk -F '-' '{print $1}' | awk -F '.' '{print $1"."$2}')
PHP_VERSION=$(docker exec -t "${PROJECT}_web_1" php -v | head -n1 | awk '{print $2}' | awk -F '-' '{print $1}' | awk -F '.' '{print $1"."$2}')
docker exec -t "${PROJECT}_web_1" sed -i "s/^xdebug\.remote_host=.*$/xdebug.remote_host=${HOST_IP}/" "/etc/php/${PHP_VERSION}/mods-available/xdebug.ini"
set +e
docker exec -t -u root "${PROJECT}_web_1" apachectl graceful 2> /dev/null
Expand Down

0 comments on commit c32e57d

Please sign in to comment.