diff --git a/installer/ga_postinstall_setup.sh b/installer/ga_postinstall_setup.sh new file mode 100755 index 0000000..f0c7a48 --- /dev/null +++ b/installer/ga_postinstall_setup.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +tmp=$(mktemp) + +cd /var/www/ga + +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 diff --git a/installer/ga_setup.sh b/installer/ga_preinstall_setup.sh similarity index 66% rename from installer/ga_setup.sh rename to installer/ga_preinstall_setup.sh index f3cc871..27567ca 100755 --- a/installer/ga_setup.sh +++ b/installer/ga_preinstall_setup.sh @@ -17,7 +17,6 @@ if [ $? != 0 ]; then exit 1 fi - cd config whiptail --msgbox "Adding BROADCAST_DRIVER env" 7 31 @@ -27,27 +26,3 @@ 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 diff --git a/installer/install.sh b/installer/install.sh index a5dd44e..9e5b5d2 100755 --- a/installer/install.sh +++ b/installer/install.sh @@ -26,11 +26,15 @@ fi if [ $? != 0 ]; then exit 1 fi +./ga_preinstall_setup.sh +if [ $? != 0 ]; then + exit 1 +fi ./ga_install.sh if [ $? != 0 ]; then exit 1 fi -./ga_setup.sh +./ga_postinstall_setup.sh if [ $? != 0 ]; then exit 1 fi