1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/archivist_ynh.git synced 2024-09-03 18:15:55 +02:00

Merge pull request #3 from YunoHost-Apps/testing

Testing
This commit is contained in:
Maniack Crudelis 2017-12-23 23:57:07 +01:00 committed by GitHub
commit 898c9f70db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 5 deletions

View file

@ -343,6 +343,23 @@ ynh_exec_fully_quiet () {
eval $@ > /dev/null 2>&1
}
# Remove any logs for all the following commands.
#
# usage: ynh_print_OFF
# WARNING: You should be careful with this helper, and never forgot to use ynh_print_ON as soon as possible to restore the logging.
ynh_print_OFF () {
set +x
}
# Restore the logging after ynh_print_OFF
#
# usage: ynh_print_ON
ynh_print_ON () {
set -x
# Print an echo only for the log, to be able to know that ynh_print_ON has been called.
echo ynh_print_ON > /dev/null
}
#=================================================
# Install or update the main directory yunohost.multimedia

View file

@ -21,10 +21,10 @@ ynh_abort_if_errors
#=================================================
encrypt=$YNH_APP_ARG_ENCRYPT
encryption_pwd=$YNH_APP_ARG_ENCRYPTION_PWD
ynh_print_OFF; encryption_pwd=$YNH_APP_ARG_ENCRYPTION_PWD; ynh_print_ON
core_backup=$YNH_APP_ARG_CORE_BACKUP
apps_backup=$YNH_APP_ARG_APPS_BACKUP
frequency=$YNH_APP_ARG_FREQUENCY
frequency="$YNH_APP_ARG_FREQUENCY"
app=$YNH_APP_INSTANCE_NAME
@ -36,14 +36,16 @@ final_path=/opt/yunohost/$app
test ! -e "$final_path" || ynh_die "This path already contains a folder"
if [ $encrypt -eq 1 ]; then
ynh_print_OFF
test -n "$encryption_pwd" || ynh_die "encryption_pwd can't be empty if you choose to enable encryption."
ynh_print_ON
fi
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_app_setting_set $app frequency $frequency
ynh_app_setting_set $app frequency "$frequency"
#=================================================
# STANDARD MODIFICATIONS
@ -90,7 +92,7 @@ then
encrypt=true
passkey="$final_path/passkey"
echo "$encryption_pwd" > "$passkey"
ynh_print_OFF; echo "$encryption_pwd" > "$passkey"; ynh_print_ON
chmod 400 "$passkey"
else
encrypt=false
@ -174,6 +176,7 @@ $Informations" >&2
# SEND A README FOR THE ADMIN
#=================================================
ynh_print_OFF
if [ "$encrypt" = "true" ]
then
encrypt_message="Your password for encryption is '$encryption_pwd'
@ -192,3 +195,4 @@ Please read the documentation (https://github.com/maniackcrudelis/archivist/blob
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/archivist_ynh"
ynh_send_readme_to_admin "$message" "root"
ynh_print_ON

View file

@ -23,7 +23,7 @@ ynh_abort_if_errors
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path)
frequency=$(ynh_app_setting_get $app frequency)
frequency="$(ynh_app_setting_get $app frequency)"
#=================================================
# CHECK VERSION