1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wikijs_ynh.git synced 2024-09-03 20:36:09 +02:00

Apply example_ynh

This commit is contained in:
yalh76 2021-05-13 22:26:00 +02:00
parent aa86c664d6
commit f69855a45a
3 changed files with 4 additions and 21 deletions

View file

@ -129,7 +129,7 @@ yunohost user create $ldap_user --firstname "SvcWikijsLdap" --lastname "SvcWikij
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding a config file..." ynh_script_progression --message="Adding a configuration file..."
ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml" ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml"

View file

@ -54,7 +54,7 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action=stop --log_path=systemd --line_match="Stopped wikijs service" ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped wikijs service"
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
@ -163,7 +163,7 @@ ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Updating a config file..." ynh_script_progression --message="Updating a configuration file..."
ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml" ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml"

View file

@ -72,17 +72,7 @@ ynh_send_readme_to_admin() {
Specific information for the application $app. Specific information for the application $app.
$(if [ -n "$app_message" ] $(cat "$app_message")"
then
cat "$app_message"
else
echo "...No specific information..."
fi)
---
Automatic diagnosis data from YunoHost
__PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')__PRE_TAG2__"
# Store the message into a file for further modifications. # Store the message into a file for further modifications.
echo "$mail_message" > mail_to_send echo "$mail_message" > mail_to_send
@ -103,10 +93,6 @@ __PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/service
# Insert url links tags # Insert url links tags
ynh_replace_string "__URL_TAG1__\(.*\)__URL_TAG2__\(.*\)__URL_TAG3__" "<a href=\"\2\">\1</a>" mail_to_send ynh_replace_string "__URL_TAG1__\(.*\)__URL_TAG2__\(.*\)__URL_TAG3__" "<a href=\"\2\">\1</a>" mail_to_send
# Insert pre tags
ynh_replace_string "__PRE_TAG1__" "<pre>" mail_to_send
ynh_replace_string "__PRE_TAG2__" "<\pre>" mail_to_send
# Insert finishing HTML tags # Insert finishing HTML tags
echo -e "\n</body>\n</html>" >> mail_to_send echo -e "\n</body>\n</html>" >> mail_to_send
@ -115,9 +101,6 @@ __PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/service
# Remove URL tags # Remove URL tags
ynh_replace_string "__URL_TAG[1,3]__" "" mail_to_send ynh_replace_string "__URL_TAG[1,3]__" "" mail_to_send
ynh_replace_string "__URL_TAG2__" ": " mail_to_send ynh_replace_string "__URL_TAG2__" ": " mail_to_send
# Remove PRE tags
ynh_replace_string "__PRE_TAG[1-2]__" "" mail_to_send
fi fi
# Define binary to use for mail command # Define binary to use for mail command