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

install: modernize checking for domain availability

This commit is contained in:
Pierre de La Morinerie 2017-09-12 17:31:22 +05:30
parent 27e7851dcc
commit ee502444c6

View file

@ -4,7 +4,7 @@
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
is_public=$YNH_APP_ARG_PUBLIC_SITE is_public=$YNH_APP_ARG_PUBLIC_SITE
analytics=$YNH_APP_ARG_ANALYTICS analytics=$YNH_APP_ARG_ANALYTICS
path="" path_url="/"
# Source app helpers # Source app helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -45,11 +45,13 @@ then
script_die "Mattermost requires MySQL 5.6 or higher, or MariaDB 10 or higher." script_die "Mattermost requires MySQL 5.6 or higher, or MariaDB 10 or higher."
fi fi
# Check domain availability # Normalize the url path syntax
sudo yunohost app checkurl $domain$path -a mattermost path_url=$(ynh_normalize_url_path $path_url)
if [[ ! $? -eq 0 ]]; then # Check web path availability
script_die "The app cannot be installed at '$domain$path': this location is already used." ynh_webpath_available $domain $path_url
fi # Register (book) web path
ynh_webpath_register $app $domain $path_url
# Store setting
ynh_app_setting_set mattermost domain "$domain" ynh_app_setting_set mattermost domain "$domain"
# Install dependencies # Install dependencies