mirror of
https://github.com/YunoHost-Apps/rspamdui_ynh.git
synced 2024-09-03 20:16:32 +02:00
46 lines
1.5 KiB
Bash
46 lines
1.5 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
|
#=================================================
|
|
|
|
password=$YNH_APP_ARG_PASSWORD
|
|
ynh_app_setting_set --app=$app --key=password --value=$password
|
|
|
|
#=================================================
|
|
# STANDARD MODIFICATIONS
|
|
#=================================================
|
|
# NGINX CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring NGINX web server..."
|
|
|
|
# Create a dedicated NGINX config
|
|
ynh_add_nginx_config
|
|
|
|
#=================================================
|
|
# SPECIFIC SETUP
|
|
#=================================================
|
|
# CONFIGURE RSPAMD
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring RSPAMD..."
|
|
|
|
encrypted_password=$(rspamadm pw -p $password)
|
|
|
|
ynh_replace_special_string --match_string="^password = .*" --replace_string="password = \"$encrypted_password\";" --target_file=/etc/rspamd/worker-controller.inc
|
|
|
|
ynh_systemd_action --service_name=rspamd --action="restart"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Installation of $app completed"
|