#!/bin/bash tmp=$(mktemp) cd /var/www/ga whiptail --msgbox "Configuring broadcaster and lighthouse" 7 44 cp .env .env.bak awk '/BROADCAST_DRIVER/{sub(/=.*/, "=redis"); print "LIGHTHOUSE_BROADCASTER=echo"; print "LIGHTHOUSE_CACHE_TTL=200"}{print $0}' .env > "$tmp" && mv "$tmp" .env if [ $? != 0 ]; then echo -e "\033[0;31mCould not set GermanAirlines specific env variables" exit 1 fi cd config whiptail --msgbox "Adding BROADCAST_DRIVER env" 7 31 cp broadcasting.php broadcasting.php.bak sed "s/'default' => 'pusher',/'default' => env('BROADCAST_DRIVER', 'pusher'),/" broadcasting.php > "$tmp" && mv "$tmp" broadcasting.php if [ $? != 0 ]; then echo -e "\033[0;31mCould not patch broadcasting config" exit 1 fi cd .. whiptail --msgbox "Linking graphs directory" 7 28 mkdir graphql if [ $? != 0 ]; then echo -e "\033[0;31mCould not add graphql directory" exit 1 fi cd graphql ln -s ../plugins/germanairlinesva/graphql/graphs if [ $? != 0 ]; then echo -e "\033[0;31mCould not link graphs directory" exit 1 fi cd .. whiptail --msgbox "Setting ownership" 7 21 chown www-data -R . if [ $? != 0 ]; then echo -e "\033[0;31mCould not set ownership to www-data" exit 1 fi