1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yunomonitor_ynh.git synced 2024-09-03 17:46:11 +02:00
This commit is contained in:
ericgaspar 2021-08-16 09:20:33 +02:00
parent bdfb5adc29
commit 71357ce26a
5 changed files with 12 additions and 12 deletions

View file

@ -3,7 +3,8 @@
"id": "yunomonitor", "id": "yunomonitor",
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "Home made tool to monitor automatically your servers." "en": "Home made tool to monitor automatically your servers",
"fr": "Outil pour surveiller automatiquement vos serveurs"
}, },
"version": "1.1.0~ynh1", "version": "1.1.0~ynh1",
"url": "https://github.com/zamentur/yunomonitor", "url": "https://github.com/zamentur/yunomonitor",
@ -14,7 +15,7 @@
"url": "https://reflexlibre.net" "url": "https://reflexlibre.net"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.6" "yunohost": ">= 4.2.0"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [

View file

@ -20,7 +20,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -28,20 +28,19 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
#================================================= #=================================================
# STANDARD BACKUP STEPS # DECLARE DATA AND CONF FILES TO BACKUP
#================================================= #=================================================
ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Backing up the main app directory..." --time --weight=1
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Backing up nginx web server configuration..." --time --weight=1
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/000-$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/000-$app.conf"
@ -50,7 +49,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/000-$app.conf"
#================================================= #=================================================
# BACKUP SYSTEMD # BACKUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Backing up systemd configuration..." --time --weight=1
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
@ -64,4 +62,4 @@ ynh_backup --src_path="/etc/systemd/system/$app.timer"
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --time --last ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -92,12 +92,14 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# CONFIGURE SYSTEMD TIMER # CONFIGURE SYSTEMD TIMER
#================================================= #=================================================
ynh_add_systemd_config ynh_add_systemd_config
cp ../conf/systemd.timer "/etc/systemd/system/$app.timer" cp ../conf/systemd.timer "/etc/systemd/system/$app.timer"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/systemd/system/$app.timer" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/systemd/system/$app.timer"
systemctl daemon-reload systemctl daemon-reload
systemctl enable $app.timer systemctl enable $app.timer --quiet
systemctl start $app.timer systemctl start $app.timer
#================================================= #=================================================
#================================================= #=================================================

View file

@ -75,8 +75,8 @@ chmod u+x $final_path/yunomonitor.py
ynh_script_progression --message="Activating systemd timer..." --weight=1 ynh_script_progression --message="Activating systemd timer..." --weight=1
systemctl daemon-reload systemctl daemon-reload
systemctl enable $app.service systemctl enable $app.service --quiet
systemctl enable $app.timer systemctl enable $app.timer --quiet
systemctl start $app.timer systemctl start $app.timer
#================================================= #=================================================

View file

@ -115,7 +115,6 @@ ynh_backup_if_checksum_is_different --file="$final_path/conf/$app.yml"
# Recalculate and store the checksum of the file for the next upgrade. # Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$final_path/conf/$app.yml" ynh_store_file_checksum --file="$final_path/conf/$app.yml"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================