29 lines
950 B
Bash
Executable File
29 lines
950 B
Bash
Executable File
#!/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 $0; print "LIGHTHOUSE_BROADCASTER=echo"; print "LIGHTHOUSE_CACHE_TTL=200"; next}{print $0}' .env > "$tmp" && mv "$tmp" .env
|
|
if [ $? != 0 ]; then
|
|
echo -e "\033[0;31mCould not set GermanAirlines specific env variables"
|
|
exit 1
|
|
fi
|
|
awk '/REDIS_PORT=*/{print $0; print "REDIS_PREFIX="; next}{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
|