Use getop for ynh_replace_string

This commit is contained in:
Josué Tille 2019-09-10 21:26:06 +02:00
parent 7bb3ceb1fe
commit 3a6e4b46d7
No known key found for this signature in database
GPG Key ID: 716A6C99B04194EF
3 changed files with 8 additions and 8 deletions

View File

@ -42,7 +42,7 @@ create_dir() {
config_nginx() {
if [ "$path_url" != "/" ]
then
ynh_replace_string "^#sub_path_only" "" "../conf/nginx.conf"
ynh_replace_string --match_string "^#sub_path_only" --replace_string "" --target_file "../conf/nginx.conf"
fi
ynh_add_nginx_config
}
@ -58,7 +58,7 @@ config_gitea() {
then
ynh_replace_string --match_string __URL__ --replace_string "$domain" --target_file "$final_path/custom/conf/app.ini"
else
ynh_replace_string "__URL__" "$domain${path_url%/}" "$final_path/custom/conf/app.ini"
ynh_replace_string --match_string __URL__ --replace_string "$domain${path_url%/}" --target_file "$final_path/custom/conf/app.ini"
fi
ynh_replace_string --match_string __REPOS_PATH__ --replace_string "$REPO_PATH" --target_file "$final_path/custom/conf/app.ini"

View File

@ -95,8 +95,8 @@ do
done
# Add ldap config
ynh_replace_string "__ADMIN__" "$admin" ../conf/login_source.sql
ynh_replace_string "__APP__" "$app" ../conf/login_source.sql
ynh_replace_string --match_string "__ADMIN__" --replace_string "$admin" --target_file ../conf/login_source.sql
ynh_replace_string --match_string "__APP__" --replace_string "$app" --target_file ../conf/login_source.sql
ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ../conf/login_source.sql
# SETUP FAIL2BAN

View File

@ -62,8 +62,8 @@ if [[ $migration_process -eq 1 ]]; then
ynh_secure_remove --file=$final_path/custom/conf/auth.d
# Restore authentication from SQL database
ynh_replace_string "__ADMIN__" "$admin" ../conf/login_source.sql
ynh_replace_string "__APP__" "$app" ../conf/login_source.sql
ynh_replace_string --match_string __ADMIN__ --replace_string "$admin" --target_file ../conf/login_source.sql
ynh_replace_string --match_string __APP__ --replace_string "$app" --target_file ../conf/login_source.sql
ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ../conf/login_source.sql
# Fix hooks
@ -201,8 +201,8 @@ you don't see Gogs as installed." >&2
# Execute a post migration script after the end of this upgrade.
# Mainly for some cleaning
script_post_migration=gogs_post_migration.sh
ynh_replace_string "__OLD_APP__" "$old_app" ../conf/$script_post_migration
ynh_replace_string "__NEW_APP__" "$app" ../conf/$script_post_migration
ynh_replace_string --match_string __OLD_APP__ --replace_string "$old_app" --target_file ../conf/$script_post_migration
ynh_replace_string --match_string __NEW_APP__ --replace_string "$app" --target_file ../conf/$script_post_migration
cp ../conf/$script_post_migration /tmp
chmod +x /tmp/$script_post_migration
(cd /tmp; echo "/tmp/$script_post_migration > /tmp/$script_post_migration.log 2>&1" | at now + 2 minutes)