1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rocketchat_ynh.git synced 2024-09-03 20:16:25 +02:00

sanitize path

This commit is contained in:
Clément 2018-05-05 11:51:14 +02:00
parent f7b304c753
commit ab4b0f7e8c

View file

@ -34,6 +34,16 @@ workdir=$(pwd)
# find suitable port (default 3000)
port=$(ynh_find_port 3000)
# if path do not begin with / add a / at the begining
if [ "${path:0:1}" != "/" ]; then
path="/$path"
fi
# if path do not end with / add a / at the end
if [ "${path:${#path}-1}" != "/" ] && [ ${#path} -gt 1 ]; then
path="$path/"
fi
# Check domain/path availability
ynh_webpath_available $domain $path
if [[ ! $? -eq 0 ]]; then