From 3c9860d5b46aa5027c146cfb15434ea23ff1ae71 Mon Sep 17 00:00:00 2001 From: Moul Date: Wed, 5 Apr 2017 19:09:10 +0200 Subject: [PATCH] [enh] #20: form install: resolve domain name with '--resolve' curl option. - instead of modifying '/etc/hosts'. --- scripts/install | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 01acd56..93ca431 100644 --- a/scripts/install +++ b/scripts/install @@ -63,9 +63,6 @@ ynh_app_setting_set "$app" unprotected_uris "/" 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_path=$([ "$path" == "/" ] || echo $path) @@ -74,7 +71,7 @@ curl -kL -o install_page.html https://$domain$curl_path/install.php >/dev/null 2 # 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 -curl -k -X POST \ +curl -k -X POST --resolve "$domain:443:localhost"\ --data-urlencode "default_lang=$default_lang" \ --data-urlencode "install=Installer" \ --data-urlencode "name=$admin" \ @@ -86,9 +83,6 @@ curl -k -X POST \ sudo rm -f $src_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 ynh_app_setting_delete "$app" unprotected_uris