mirror of
https://github.com/YunoHost-Apps/freshrss_ynh.git
synced 2024-09-03 18:36:33 +02:00
add path check
This commit is contained in:
parent
4b7c370628
commit
87d9738c6d
1 changed files with 9 additions and 1 deletions
|
@ -8,7 +8,7 @@ set -eu
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path=$YNH_APP_ARG_PATH
|
path=${YNH_APP_ARG_PATH%/}
|
||||||
admin_user=$YNH_APP_ARG_ADMIN
|
admin_user=$YNH_APP_ARG_ADMIN
|
||||||
# Setup variables
|
# Setup variables
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
@ -20,6 +20,14 @@ FINAL_PATH="/var/www/$app"
|
||||||
# Source app helpers
|
# Source app helpers
|
||||||
. /usr/share/yunohost/helpers
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
# copy past from nextcloud package
|
||||||
|
if [ "${path:0:1}" != "/" ] && [ ${#path} -gt 0 ]; then
|
||||||
|
path="/$path"
|
||||||
|
fi
|
||||||
|
if [ "${path:${#path}-1}" == "/" ] && [ ${#path} -gt 1 ]; then
|
||||||
|
path="${path:0:${#path}-1}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Check user parameter if not empty
|
# Check user parameter if not empty
|
||||||
if [[ $admin_user != '' ]]; then
|
if [[ $admin_user != '' ]]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue