From d7e4fd20bf3edf64dfbcf0c9731ffe694039b6e9 Mon Sep 17 00:00:00 2001 From: matlink Date: Sun, 23 Nov 2014 17:30:50 +0100 Subject: [PATCH] [fix] adding domain into /etc/hosts for install on subdomains --- scripts/install | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/install b/scripts/install index 19de0b9..e6df976 100644 --- a/scripts/install +++ b/scripts/install @@ -55,9 +55,14 @@ sudo yunohost app setting $app unprotected_uris -v "/" sudo service nginx reload sudo yunohost app ssowatconf +#temporary add domain name to /etc/hosts +sudo sed -i "1 i\127.0.0.1 $domain #pluxml_hosts" /etc/hosts + #make request to install app #get the html page curl -kL -o install_page.html https://$domain$path/install.php >/dev/null 2>&1 + + #get the token for form validation token=$(cat install_page.html | grep "input" | grep "token" | tail -1 | cut -d' ' -f3 | cut -d'"' -f2) #send http POST values @@ -73,6 +78,9 @@ curl -k -X POST \ sudo rm -f $final_path/install.php +#remove domain name from /etc/hosts +sudo sed -i "/#pluxml_hosts/d" /etc/hosts + # If app is private, remove url to SSOWat conf from skipped_uris if [ "$is_public" = "No" ]; then