Fix change-url script

Use sed instead of ynh_replace_string for more flexibility
This commit is contained in:
Josué Tille 2019-08-05 15:36:02 +02:00
parent dfc0645d18
commit 3e8e47ac63
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF

View file

@ -82,9 +82,9 @@ ynh_replace_string --match_string 'SITE_ROOT = "'"$old_path2"'"' --replace_strin
ynh_replace_string --match_string 'MEDIA_URL = "'"$old_path2"'media/"' --replace_string 'MEDIA_URL = "'"$path_url2"'media/"' --target_file $final_path/conf/seahub_settings.py
ynh_replace_string --match_string "LOGIN_URL = '${old_path2}accounts/login/'" --replace_string "LOGIN_URL = '${path_url2}accounts/login/'" --target_file $final_path/conf/seahub_settings.py
ynh_replace_string --match_string ' = "seafile@'"$old_domain"'"' --replace_string ' = "seafile@'"$domain"'"' --target_file $final_path/conf/seahub_settings.py
sed --in-place "s@ALLOWED_HOSTS = \['${old_domain}'\]@ALLOWED_HOSTS = \['${domain}'\]@g" --target_file $final_path/conf/seahub_settings.py
sed --in-place "s@ALLOWED_HOSTS = \['${old_domain}'\]@ALLOWED_HOSTS = \['${domain}'\]@g" $final_path/conf/seahub_settings.py
ynh_replace_string --match_string "REMOTE_USER_DOMAIN = '$old_domain'" --replace_string "REMOTE_USER_DOMAIN = '$domain'" --target_file $final_path/conf/seahub_settings.py
ynh_replace_string --match_string "REMOTE_USER_PROTECTED_PATH = ['$old_path', '$old_path/accounts/login']" --replace_string "REMOTE_USER_PROTECTED_PATH = ['$path_url', '$path_url/accounts/login']" --target_file $final_path/conf/seahub_settings.py
sed --in-place "s@REMOTE_USER_PROTECTED_PATH = \['$old_path', '$old_path/accounts/login'\]@REMOTE_USER_PROTECTED_PATH = \['$path_url', '$path_url/accounts/login'\]@g" $final_path/conf/seahub_settings.py
ynh_script_progression --message="Updating seafile database" --weight=7