From e962ed4af28b7eba52d9bcc4890b250701b16c32 Mon Sep 17 00:00:00 2001 From: Adam Maracz Date: Sat, 17 Apr 2021 15:59:46 +0200 Subject: [PATCH] Create run.sh --- run.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 run.sh diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..ee9bd14 --- /dev/null +++ b/run.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Legacy WebOS Youtube Service startup script + +# Update config.php keys based on environmental variables +if [ $YOUTUBE_API_KEY ]; then sed -i "/api_key/c\\\t'api_key' => '$YOUTUBE_API_KEY'," /var/www/html/config.php; fi +if [ $YOUTUBE_CLIENT_KEY ]; then sed -i "/client_key/c\\\t'client_key' => '$YOUTUBE_CLIENT_KEY'," /var/www/html/config.php; fi +if [ $YOUTUBE_DEBUG_KEY ]; then sed -i "/debug_key/c\\\t'debug_key' => '$YOUTUBE_DEBUG_KEY'," /var/www/html/config.php; fi +if [ $YOUTUBE_SERVER_ID ]; then sed -i "/server_id/c\\\t'server_id' => '$YOUTUBE_SERVER_ID'" /var/www/html/config.php; fi + +# Start Apache +rm -f /var/run/apache2/apache2.pid +apachectl -DFOREGROUND