config 950 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. source /etc/yunohost/apps/$app/scripts/_common.sh
  3. source /usr/share/yunohost/helpers
  4. ynh_abort_if_errors
  5. # my code starts here:
  6. get__flohmarkt_initial_setup_url(){
  7. local init_key="$(flohmarkt_ynh_get_initialization_key)"
  8. # TODO: wenn leer, dann etwas anderes zurückgeben
  9. if ! [[ -v init_key ]] ||
  10. [[ "${init_key}" == 'null' ]] ||
  11. [[ -z "${init_key}" ]]
  12. then
  13. if flohmarkt_initialized; then
  14. echo '✅ <b>done already</b>'
  15. else
  16. echo "<b><font color=\"red\">error:</font></b> couldn't find the initialization key"
  17. fi
  18. else
  19. echo -n "<b><a href=\"https://${domain}/setup/${init_key}\" target=\"_blank\">"
  20. echo "https://${domain}/setup/${init_key}</a></b>"
  21. fi
  22. }
  23. # https://yunohost.org/en/packaging_config_panels#custom-getter-setter
  24. # we're supposed to put this here, to fill variables with values from settings
  25. ynh_app_config_run $1