1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/calibreweb_ynh.git synced 2024-09-03 18:16:20 +02:00

stop app before upgrade

This commit is contained in:
Krakinou 2019-01-30 00:05:19 +01:00
parent 8f987cc6f8
commit 1be8c6e4a6

View file

@ -44,6 +44,9 @@ ynh_clean_setup () {
# 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
#Stop the app in case database is updated
ynh_systemd_action -a stop
#================================================= #=================================================
# CHECK THE PATH # CHECK THE PATH
#================================================= #=================================================
@ -99,8 +102,11 @@ ynh_multimedia_addaccess $app
ynh_backup_if_checksum_is_different "$final_path/app.db" ynh_backup_if_checksum_is_different "$final_path/app.db"
#set database settings as per conf file : restart server so that app.db is regenerated, then add new ldap settings #set database settings as per conf file : restart server so that app.db is regenerated, then add new ldap settings
ynh_systemd_action -a stop
ynh_systemd_action -l "INFO in server: Starting Gevent server" ynh_systemd_action -l "INFO in server: Starting Gevent server"
#sleep required on low spec like raspberryPi
sleep 2s
ynh_systemd_action -a stop
conf="\"UPDATE settings SET $(. <(echo -E echo $(<../conf/init_calibre_db_ldap_settings))) WHERE ID=1\"" conf="\"UPDATE settings SET $(. <(echo -E echo $(<../conf/init_calibre_db_ldap_settings))) WHERE ID=1\""
eval sqlite3 $final_path/app.db "$conf" eval sqlite3 $final_path/app.db "$conf"