upgrade 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. #=================================================
  3. # IMPORT GENERIC HELPERS
  4. #=================================================
  5. source _common.sh
  6. source /usr/share/yunohost/helpers
  7. #=================================================
  8. # DOWNLOAD, CHECK AND UNPACK SOURCE
  9. #=================================================
  10. pushd $install_dir
  11. ynh_exec_as_app $install_dir/pip install -U open-webui
  12. ynh_exec_as_app open-webui serve
  13. popd
  14. chown -R "$app:www-data" "$install_dir"
  15. #=================================================
  16. # REAPPLY SYSTEM CONFIGURATION
  17. #=================================================
  18. ynh_script_progression "Upgrading system configurations related to $app..."
  19. ynh_config_add_nginx
  20. ynh_config_add_logrotate
  21. #ynh_config_add_fail2ban --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
  22. #=================================================
  23. # START SYSTEMD SERVICE
  24. #=================================================
  25. ynh_script_progression "Starting $app's systemd service..."
  26. ynh_systemctl --service="$app" --action="start"
  27. #=================================================
  28. # END OF SCRIPT
  29. #=================================================
  30. ynh_script_progression "Upgrade of $app completed"