mirror of
https://github.com/YunoHost-Apps/ssh_chroot_dir_ynh.git
synced 2024-09-03 20:26:26 +02:00
Apply last example_ynh
This commit is contained in:
parent
2617bebdb2
commit
a31d147ed7
7 changed files with 96 additions and 219 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +0,0 @@
|
||||||
*.swp
|
|
||||||
*~
|
|
||||||
Notes
|
|
117
YEP.md
117
YEP.md
|
@ -1,117 +0,0 @@
|
||||||
#### [Level 0](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-0)
|
|
||||||
[YEP 1.1 - Nommer son app et son dépot](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
|
|
||||||
`Validated`
|
|
||||||
[YEP 1.2 - Inscrire l'app sur un "répertoire" connu](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-12)
|
|
||||||
`Validated`
|
|
||||||
|
|
||||||
#### [Level 1](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-1)
|
|
||||||
[YEP 2.2 - Utiliser bash pour les scripts principaux](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-22)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.5 - Copier correctement des fichiers](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-25)
|
|
||||||
`Don't know`
|
|
||||||
[YEP 2.7 - Donner des permissions suffisantes aux instructions bash](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-27)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.15 - Suivre les instructions d'installation de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-215)
|
|
||||||
`Validated`
|
|
||||||
|
|
||||||
#### [Level 2](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-2)
|
|
||||||
[YEP 1.5 - Mettre à jour régulièrement le statut de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.18.2 - Gérer l'installation à la racine d’un nom de domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2182)
|
|
||||||
`Not applicable`
|
|
||||||
[YEP 2.18.3 - Gérer l'installation sur un sous-domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2183)
|
|
||||||
`Not applicable`
|
|
||||||
[YEP 2.18.4 - Gérer l'installation sur un chemin /path](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2184)
|
|
||||||
`Not applicable`
|
|
||||||
[YEP 4.6 - Gère le multi-instance](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
|
|
||||||
#### [Level 3](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-3)
|
|
||||||
[YEP 2.3 - Sauvegarder les réponses lors de l'installation](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-23)
|
|
||||||
`Validated`
|
|
||||||
|
|
||||||
#### [Level 4](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-4)
|
|
||||||
[YEP 4.1 - Lier au ldap](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-41)
|
|
||||||
`Not applicable`
|
|
||||||
[YEP 4.2 - Lier l'authentification au sso](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-42)
|
|
||||||
`Not applicable`
|
|
||||||
|
|
||||||
#### [Level 5](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-5)
|
|
||||||
[YEP 1.3 - Indiquer la licence associée au paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-13)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.1 - Respecter le format du manifeste](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-21)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
[YEP 2.12 - Utiliser les commandes pratiques (helpers)](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-212)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.18.1 - Lancer le script d'installation d'une webapp correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2181)
|
|
||||||
`Not applicable`
|
|
||||||
|
|
||||||
#### [Level 6](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-6)
|
|
||||||
[YEP 1.4 - Informer sur l'intention de maintenir un paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-14)
|
|
||||||
`Validated`
|
|
||||||
[YEP 1.6 - Se tenir informé sur l'évolution du packaging d'apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-16)
|
|
||||||
`Validated`
|
|
||||||
[YEP 1.7 - Ajouter l'app à l'organisation YunoHost-Apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-17)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
[YEP 1.8 - Publier des demandes de test](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-18)
|
|
||||||
`Validated`
|
|
||||||
[YEP 1.9 - Documenter l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-19)
|
|
||||||
`Not yet validated`
|
|
||||||
[YEP 1.10 - Garder un historique de version propre](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-110)
|
|
||||||
`Don't know`
|
|
||||||
[YEP 2.9 - Enlever toutes traces de l'app lors de la suppression](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-29)
|
|
||||||
`Validated`
|
|
||||||
[YEP 3.3 - Faciliter le contrôle de l'intégrité des sources](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-33)
|
|
||||||
`Validated`
|
|
||||||
[YEP 3.5 - Suivre les recommendations de la documentation de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-35)
|
|
||||||
`Validated`
|
|
||||||
[YEP 3.6 - Mettre à jour les versions contenant des CVE](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-36)
|
|
||||||
`Validated`
|
|
||||||
[YEP 4.3 - Fournir un script de sauvegarde YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-43)
|
|
||||||
`Not yet validated`
|
|
||||||
[YEP 4.4 - Fournir un script de restauration YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-44)
|
|
||||||
`Not yet validated`
|
|
||||||
|
|
||||||
#### [Level 7](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-7)
|
|
||||||
[YEP 2.6 - Annuler l'action si les valeurs d'entrées sont incorrectes](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-26)
|
|
||||||
`Validated`
|
|
||||||
[YEP 3.2 - Ouvrir un port correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-32)
|
|
||||||
`Not applicable`
|
|
||||||
|
|
||||||
#### [Level 8](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-8)
|
|
||||||
[YEP 2.4 - Détecter et gérer les erreurs](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-24)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.8 - Modifier correctement une configuration système](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-28)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.16 - Vérifier la disponibilité des dépendances sur ARM, x86 et x64](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-216)
|
|
||||||
`Not yet validated` - *Automatically verified.*
|
|
||||||
[YEP 2.18.5 - Gérer la tuile YunoHost pour faciliter la navigation entre les applications](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2185)
|
|
||||||
`Not applicable`
|
|
||||||
[YEP 3.4 - Isoler l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-34)
|
|
||||||
`Validated`
|
|
||||||
[YEP 4.5 - Utiliser les hooks](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-45)
|
|
||||||
`Not applicable`
|
|
||||||
|
|
||||||
#### [Level 9](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-9)
|
|
||||||
[YEP 2.10 - Configurer les logs de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-210)
|
|
||||||
`Not applicable`
|
|
||||||
[YEP 2.11 - Utiliser une variable plutôt que l'app id directement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-211)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.13 - Traduire le paquet en anglais](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-213)
|
|
||||||
`Not yet validated`
|
|
||||||
[YEP 2.14 - Remplir correctement un fichier de conf](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-214)
|
|
||||||
`Not yet validated`
|
|
||||||
[YEP 2.17 - Prendre en compte la version d'origine lors des mises à jour](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-217)
|
|
||||||
`Validated`
|
|
||||||
[YEP 4.2.1 - Déconnexion](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-421)
|
|
||||||
`Not applicable`
|
|
||||||
|
|
||||||
#### Other YEP
|
|
||||||
[YEP 3.1 - Ne pas demander ou stocker de mot de passe LDAP](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-31)
|
|
||||||
`Validated`
|
|
||||||
[YEP 4.7 - Ajouter un module à la CLI](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-47)
|
|
||||||
`Not applicable`
|
|
||||||
[YEP 4.8 - Ajouter un module à l'admin web](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-48)
|
|
||||||
`Not applicable`
|
|
||||||
|
|
||||||
State of each YEP can be one of these: `Validated`, `Partially validated`, `Not yet validated`, `Not applicable`, `Don't know`.
|
|
|
@ -29,7 +29,7 @@
|
||||||
"services": [
|
"services": [
|
||||||
],
|
],
|
||||||
"arguments": {
|
"arguments": {
|
||||||
"install" : [
|
"install": [
|
||||||
{
|
{
|
||||||
"name": "ssh_user",
|
"name": "ssh_user",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
ynh_clean_check_starting
|
true
|
||||||
}
|
}
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
@ -22,10 +22,9 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Retrieve arguments from the manifest" --weight=2
|
|
||||||
|
|
||||||
ssh_user=$YNH_APP_ARG_SSH_USER
|
ssh_user=$YNH_APP_ARG_SSH_USER
|
||||||
ynh_print_OFF; password=${YNH_APP_ARG_PASSWORD:-}; ynh_print_ON
|
password=${YNH_APP_ARG_PASSWORD:-}
|
||||||
pub_key=${YNH_APP_ARG_PUB_KEY:-}
|
pub_key=${YNH_APP_ARG_PUB_KEY:-}
|
||||||
size=$YNH_APP_ARG_SIZE
|
size=$YNH_APP_ARG_SIZE
|
||||||
|
|
||||||
|
@ -46,17 +45,15 @@ ynh_system_user_exists $ssh_user && ynh_die "This user already exist"
|
||||||
final_path=/opt/yunohost/$app
|
final_path=/opt/yunohost/$app
|
||||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||||
|
|
||||||
ynh_print_OFF
|
|
||||||
if test -z "$password" && test -z "$pub_key"
|
if test -z "$password" && test -z "$pub_key"
|
||||||
then
|
then
|
||||||
ynh_die "You can't left empty both password and public key. Please fill at least one of them."
|
ynh_die "You can't left empty both password and public key. Please fill at least one of them."
|
||||||
fi
|
fi
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# STORE SETTINGS FROM MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Storing installation settings..."
|
ynh_script_progression --message="Storing installation settings..." --weight=1
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=ssh_user --value=$ssh_user
|
ynh_app_setting_set --app=$app --key=ssh_user --value=$ssh_user
|
||||||
ynh_app_setting_set --app=$app --key=size --value=$size
|
ynh_app_setting_set --app=$app --key=size --value=$size
|
||||||
|
@ -66,7 +63,7 @@ ynh_app_setting_set --app=$app --key=size --value=$size
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..."
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
|
@ -120,13 +117,11 @@ fi
|
||||||
ynh_script_progression --message="Create the user with Chroot_manager" --weight=5
|
ynh_script_progression --message="Create the user with Chroot_manager" --weight=5
|
||||||
|
|
||||||
add_password=""
|
add_password=""
|
||||||
ynh_print_OFF
|
|
||||||
if [ -n "$password" ]
|
if [ -n "$password" ]
|
||||||
then
|
then
|
||||||
auth_opt="--password"
|
auth_opt="--password"
|
||||||
auth_value="$password"
|
auth_value="$password"
|
||||||
fi
|
fi
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
add_sshkey=""
|
add_sshkey=""
|
||||||
if [ -n "$pub_key" ]
|
if [ -n "$pub_key" ]
|
||||||
|
@ -136,12 +131,10 @@ then
|
||||||
auth_value="$pub_key"
|
auth_value="$pub_key"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ynh_print_OFF
|
|
||||||
if ! IS_PACKAGE_CHECK
|
if ! IS_PACKAGE_CHECK
|
||||||
then
|
then
|
||||||
$final_path/chroot_manager.sh adduser --name $ssh_user $auth_opt "$auth_value" --directory "$user_dir" --quota $size
|
$final_path/chroot_manager.sh adduser --name $ssh_user $auth_opt "$auth_value" --directory "$user_dir" --quota $size
|
||||||
fi
|
fi
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A LINK TO CHROOT_MANAGER
|
# ADD A LINK TO CHROOT_MANAGER
|
||||||
|
@ -189,4 +182,4 @@ ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root"
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Installation completed" --last
|
ynh_script_progression --message="Installation of $app completed" --last
|
||||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..."
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Remove app main directory"
|
ynh_script_progression --message="Remove app main directory" --weight=1
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove "$final_path"
|
ynh_secure_remove "$final_path"
|
||||||
|
@ -68,5 +68,10 @@ ynh_secure_remove "$final_path"
|
||||||
# DISCLAIMER
|
# DISCLAIMER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info "
|
ynh_print_info --message="The directory /home/yunohost.app/ssh_chroot_directories hasn't been removed."
|
||||||
The directory /home/yunohost.app/ssh_chroot_directories hasn't been removed."
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_script_progression --message="Removal of $app completed" --last
|
||||||
|
|
|
@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
ynh_clean_check_starting
|
true
|
||||||
}
|
}
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
@ -23,7 +23,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..."
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ ssh_user=$(ynh_app_setting_get --app=$app --key=ssh_user)
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating restoration parameters..."
|
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||||
|
|
||||||
test ! -d $final_path \
|
test ! -d $final_path \
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|| ynh_die --message="There is already a directory: $final_path "
|
||||||
|
@ -43,14 +43,14 @@ test ! -d $final_path \
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the app main directory..."
|
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$final_path"
|
ynh_restore_file --origin_path="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE DATA DIRECTORY
|
# RESTORE THE DATA DIRECTORY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the data directory..."
|
ynh_script_progression --message="Restoring the data directory..." --weight=1
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/home/yunohost.app/ssh_chroot_directories/$ssh_user" --not_mandatory
|
ynh_restore_file --origin_path="/home/yunohost.app/ssh_chroot_directories/$ssh_user" --not_mandatory
|
||||||
|
|
||||||
|
@ -129,4 +129,4 @@ chown -R root: $final_path
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Restoration completed for $app"
|
ynh_script_progression --message="Restoration completed for $app" --last
|
||||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..."
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -22,19 +22,18 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Checking version..."
|
ynh_script_progression --message="Checking version..." --weight=1
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
|
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
|
||||||
|
|
||||||
# Backup the current version of the app
|
# Backup the current version of the app
|
||||||
ynh_backup_before_upgrade
|
ynh_backup_before_upgrade
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
ynh_clean_check_starting
|
|
||||||
# Restore it if the upgrade fails
|
# Restore it if the upgrade fails
|
||||||
ynh_restore_upgradebackup
|
ynh_restore_upgradebackup
|
||||||
}
|
}
|
||||||
|
@ -49,7 +48,7 @@ ynh_abort_if_errors
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..."
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --dest_dir="$final_path"
|
||||||
|
@ -123,4 +122,4 @@ ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root" --type
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrade completed" --last
|
ynh_script_progression --message="Upgrade of $app completed" --last
|
||||||
|
|
Loading…
Add table
Reference in a new issue