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:
parent
27e7851dcc
commit
ee502444c6
1 changed files with 8 additions and 6 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue