From fdf22ac584d24651c7f0b43dd5fc8408c5d09afd Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sun, 16 Dec 2018 14:35:34 +0100 Subject: [PATCH] Add info messages --- scripts/install | 7 +++++-- scripts/remove | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index df68f15..b7008a5 100755 --- a/scripts/install +++ b/scripts/install @@ -68,6 +68,7 @@ ynh_app_setting_set $app calibre_dir $calibre_dir # Find a free port port=$(ynh_find_port 8083) # Open this port +ynh_print_info "Opening port $port" yunohost firewall allow --no-upnp TCP $port 2>&1 ynh_app_setting_set $app port $port @@ -76,7 +77,7 @@ ynh_app_setting_set $app port $port #================================================= ynh_app_setting_set $app final_path $final_path - +ynh_print_info "Copying data to $final_path" # Download, check integrity, uncompress and patch the source from app.src #as long as v1 is not reached, sha256sum will change without notice so not usable, so we use cp -a instead. #source are directly in the app so far @@ -88,6 +89,7 @@ cp -a ../src/. $final_path # INSTALL DEPENDENCIES #================================================= +ynh_print_info "Installing dependencies and pip packages" ynh_install_app_dependencies $pkg_dependencies pip install --target $final_path/vendor -r $final_path/requirements.txt @@ -144,6 +146,7 @@ chown -R $app:$app /var/log/$app #================================================= # SET SQLITE DATABASE SETTINGS #================================================= +ynh_print_info "Setting up database and settings" #we need to start and stop the service so that initial app.db file is created and that we can set default data systemctl start $app #sleep required on low spec like raspberryPi @@ -184,7 +187,7 @@ fi #================================================= # RELOAD NGINX #================================================= - +ynh_print_info "Reload nginx and start $app" systemctl reload nginx systemctl start $app diff --git a/scripts/remove b/scripts/remove index 44a19e5..8c32d50 100755 --- a/scripts/remove +++ b/scripts/remove @@ -14,11 +14,8 @@ source /usr/share/yunohost/helpers #================================================= app=$YNH_APP_INSTANCE_NAME - domain=$(ynh_app_setting_get $app domain) port=$(ynh_app_setting_get $app port) -db_name=$(ynh_app_setting_get $app db_name) -db_user=$db_name final_path=$(ynh_app_setting_get $app final_path) #================================================= @@ -28,6 +25,7 @@ final_path=$(ynh_app_setting_get $app final_path) #================================================= # Remove the dedicated systemd config +ynh_print_info "Removing systemd" ynh_remove_systemd_config #================================================= @@ -46,6 +44,7 @@ fi #================================================= # Remove metapackage and its dependencies +ynh_print_info "Removing dependencies" ynh_remove_app_dependencies @@ -54,6 +53,7 @@ ynh_remove_app_dependencies #================================================= # Remove the app directory securely +ynh_print_info "Removing $final_path" ynh_secure_remove "$final_path" #================================================= @@ -61,6 +61,7 @@ ynh_secure_remove "$final_path" #================================================= # Remove the dedicated nginx config +ynh_print_info "Removing nginx" ynh_remove_nginx_config #================================================= @@ -76,6 +77,7 @@ ynh_remove_logrotate if yunohost firewall list | grep -q "\- $port$" then + ynh_print_info "Removing open port $port" echo "Close port $port" >&2 yunohost firewall disallow TCP $port 2>&1 fi