Shellcheck corrections

This commit is contained in:
Jean-Baptiste Holcroft 2018-05-21 11:50:03 +02:00
parent 8eb702ab62
commit 8c8cd96094
4 changed files with 21 additions and 26 deletions

View file

@ -30,9 +30,9 @@ ynh_abort_if_errors
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get "$app" final_path)
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get "$app" domain)
db_name=$(ynh_app_setting_get $app psql_db) db_name=$(ynh_app_setting_get "$app" psql_db)
#================================================= #=================================================
# STANDARD BACKUP STEPS # STANDARD BACKUP STEPS

View file

@ -114,7 +114,7 @@ ynh_app_setting_set "$app" psqlpwd "$db_pwd"
ynh_psql_test_if_first_run ynh_psql_test_if_first_run
ynh_psql_create_user "$app" "$db_pwd" ynh_psql_create_user "$app" "$db_pwd"
ynh_psql_execute_as_root \ ynh_psql_execute_as_root \
"CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER "$app";" "CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;"
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -144,7 +144,7 @@ ynh_add_nginx_config
# Set right permissions for curl install # Set right permissions for curl install
chown -R ""$app":"$app""$datadir" chown -R "$app":"$app" "$datadir"
# Reload Nginx # Reload Nginx
systemctl reload nginx systemctl reload nginx
@ -153,12 +153,12 @@ systemctl reload nginx
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_replace_string "__domain__" "$domain" "$final_path/config/production.yaml" ynh_replace_string "__domain__" "$domain" "$final_path/config/production.yaml"
ynh_replace_string "__db_name__" "$app" "$final_path/config/production.yaml" ynh_replace_string "__db_name__" "$app" "$final_path/config/production.yaml"
ynh_replace_string "__app__" "$app" "$final_path/config/production.yaml" ynh_replace_string "__app__" "$app" "$final_path/config/production.yaml"
ynh_replace_string "__db_pwd__" "$db_pwd" "$final_path/config/production.yaml" ynh_replace_string "__db_pwd__" "$db_pwd" "$final_path/config/production.yaml"
ynh_replace_string "__email__" "$admin_email" "$final_path/config/production.yaml" ynh_replace_string "__email__" "$admin_email" "$final_path/config/production.yaml"
ynh_replace_string "__PORT__" "$port" "$final_path/config/production.yaml" ynh_replace_string "__PORT__" "$port" "$final_path/config/production.yaml"
#================================================= #=================================================
@ -223,9 +223,9 @@ systemctl reload nginx
message="PeerTube was successfully installed :) message="PeerTube was successfully installed :)
Please open "https://$domain$path_url" Please open 'https://$domain$path_url'
Here is the admin password: "$admin_pass" Here is the admin password: '$admin_pass'
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/peertube_ynh" If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/peertube_ynh"

View file

@ -1,4 +1,3 @@
#!/bin/bash #!/bin/bash
#================================================= #=================================================

View file

@ -20,7 +20,6 @@ domain=$(ynh_app_setting_get "$app" domain)
path_url="/" path_url="/"
is_public=$(ynh_app_setting_get "$app" is_public) is_public=$(ynh_app_setting_get "$app" is_public)
admin_email=$(ynh_app_setting_get "$app" admin_email) admin_email=$(ynh_app_setting_get "$app" admin_email)
admin_pass=$(ynh_app_setting_get "$app" admin_pass)
final_path=$(ynh_app_setting_get "$app" final_path) final_path=$(ynh_app_setting_get "$app" final_path)
port=$(ynh_app_setting_get "$app" port) port=$(ynh_app_setting_get "$app" port)
db_name=$(ynh_app_setting_get "$app" psql_db) db_name=$(ynh_app_setting_get "$app" psql_db)
@ -133,12 +132,12 @@ systemctl reload nginx
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_replace_string "__domain__" "$domain" "$final_path/config/production.yaml" ynh_replace_string "__domain__" "$domain" "$final_path/config/production.yaml"
ynh_replace_string "__db_name__" "$app" "$final_path/config/production.yaml" ynh_replace_string "__db_name__" "$app" "$final_path/config/production.yaml"
ynh_replace_string "__app__" "$app" "$final_path/config/production.yaml" ynh_replace_string "__app__" "$app" "$final_path/config/production.yaml"
ynh_replace_string "__db_pwd__" "$db_pwd" "$final_path/config/production.yaml" ynh_replace_string "__db_pwd__" "$db_pwd" "$final_path/config/production.yaml"
ynh_replace_string "__email__" "$admin_email" "$final_path/config/production.yaml" ynh_replace_string "__email__" "$admin_email" "$final_path/config/production.yaml"
ynh_replace_string "__PORT__" "$port" "$final_path/config/production.yaml" ynh_replace_string "__PORT__" "$port" "$final_path/config/production.yaml"
# Recalculate and store the config file checksum into the app settings # Recalculate and store the config file checksum into the app settings
@ -167,12 +166,12 @@ chown -R "$app":"$app" "$final_path" "$datadir"
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
if [ $is_public -eq 0 ] if [ "$is_public" -eq 0 ]
then # Remove the public access then # Remove the public access
ynh_app_setting_delete "$app" skipped_uris ynh_app_setting_delete "$app" skipped_uris
fi fi
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ "$is_public" -eq 1 ]
then then
# unprotected_uris allows SSO credentials to be passed anyway # unprotected_uris allows SSO credentials to be passed anyway
ynh_app_setting_set "$app" unprotected_uris "/" ynh_app_setting_set "$app" unprotected_uris "/"
@ -183,6 +182,3 @@ fi
#================================================= #=================================================
systemctl reload nginx systemctl reload nginx