This commit is contained in:
Josue 2017-01-28 18:51:23 +01:00
parent eb1f757b21
commit 63e9bff3ff
2 changed files with 63 additions and 6 deletions

View file

@ -3,11 +3,42 @@
# Exit on command errors and treat unset variables as an error # Exit on command errors and treat unset variables as an error
set -eu set -eu
# Source YunoHost helpers ######## Actually we cant use common script in backup / restore script see this issue for more informations : https://dev.yunohost.org/issues/621
source /usr/share/yunohost/helpers # # Import common cmd
# source ./_common.sh
#
# Import common cmd ######## We implement manually this fonctions
source ./_common.sh
init_script() {
# Exit on command errors and treat unset variables as an error
set -eu
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Retrieve arguments
app=$YNH_APP_INSTANCE_NAME
}
set_configuration() {
if [[ -e /var/www/$app ]]
then
final_path=/var/www/$app
seafile_user=www-data
elif [[ -e /opt/yunohost/$app ]]
then
final_path=/opt/yunohost/$app
seafile_user=seafile
else
ynh_die "Error : can't find seafile path"
fi
}
######## End of common fonctions
# Init script
init_script
# Retrieve arguments # Retrieve arguments
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME

View file

@ -1,7 +1,33 @@
#!/bin/bash #!/bin/bash
# Import common cmd ######## Actually we cant use common script in backup / restore script see this issue for more informations : https://dev.yunohost.org/issues/621
source ./_common.sh # # Import common cmd
# source ./_common.sh
#
######## We implement manually this fonctions
init_script() {
# Exit on command errors and treat unset variables as an error
set -eu
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Retrieve arguments
app=$YNH_APP_INSTANCE_NAME
}
correct_path() {
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
}
######## End of common fonctions
# Init script # Init script
init_script init_script