diff --git a/scripts/actions/clean_backups b/scripts/actions/clean_backups deleted file mode 100755 index 70af0dd..0000000 --- a/scripts/actions/clean_backups +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source scripts/_common.sh -source /usr/share/yunohost/helpers - -#================================================= -# CLEAN ALL BACKUP FILES -#================================================= -ynh_script_progression --message="Cleaning all backup files..." --weight=9 - -# Get the backup directory from the config file -backup_dir="$(grep "^backup_dir=" "$final_path/Backup_list.conf" | cut -d= -f2)" - -while read -r directory <&3; do - if [ -n "$directory" ]; then - ynh_print_info --message="Clean backup directory $directory" - ynh_secure_remove --file="$directory" - fi -done 3<<< $(find "$backup_dir" -maxdepth 1 -mindepth 1 -type d) - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Execution completed" --last diff --git a/scripts/actions/force_backup b/scripts/actions/force_backup deleted file mode 100755 index 94e88f7..0000000 --- a/scripts/actions/force_backup +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source scripts/_common.sh -source /usr/share/yunohost/helpers - -#================================================= -# FORCE A NEW BACKUP -#================================================= -ynh_script_progression --message="Forcing a new backup..." --weight=9 - -ynh_exec_warn nice -n10 "$install_dir/archivist.sh" - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Execution completed" --last diff --git a/scripts/actions/reset_default_app b/scripts/actions/reset_default_app deleted file mode 100755 index 4f325eb..0000000 --- a/scripts/actions/reset_default_app +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -# Load common variables for all scripts. -source scripts/_common.sh -source /usr/share/yunohost/helpers - -_set_frequencies - -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= - -ynh_script_progression --message="Resetting source files..." --time --weight=1 - -# Download, check integrity, uncompress and patch the source from app.src -(cd scripts; YNH_CWD=$PWD ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="passkey Backup_list.conf") - -# Set permissions on app files -chown -R "root:root" "$install_dir" - -#================================================= -# RECONFIGURE ARCHIVIST -#================================================= -ynh_script_progression --message="Reconfiguring archivist..." --time --weight=1 - -yunohost app action run "$app" reset_default_config - -#================================================= -# SYSTEM CONFIGURATION -#================================================= -ynh_script_progression --message="Resetting system configurations related to $app..." --weight=1 - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate - -# Add Cron configuration file -ynh_add_config --template="archivist.cron" --destination="/etc/cron.d/$app" - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Execution completed" --time --last diff --git a/scripts/actions/reset_default_config b/scripts/actions/reset_default_config deleted file mode 100755 index bc0bac2..0000000 --- a/scripts/actions/reset_default_config +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source scripts/_common.sh -source /usr/share/yunohost/helpers - -#================================================= -# SORT OUT THE CONFIG FILE TO HANDLE -#================================================= - -file="$1" - -if [ "$file" = "Backup_list.conf" ]; then - config_file="$install_dir/Backup_list.conf" -fi - -#================================================= -# RESET THE CONFIG FILE -#================================================= -ynh_script_progression --message="Reseting the config file $file" - -# Verify the checksum and backup the file if it's different -ynh_backup_if_checksum_is_different --file="$config_file" - -if [ "$file" = "Backup_list.conf" ]; then - if [ "$encrypt" -eq 1 ]; then - encrypt=true - passkey="$install_dir/passkey" - echo "$encryption_pwd" > "$passkey" - chmod 400 "$passkey" - else - encrypt=false - passkey=na - fi - - if [ "$core_backup" -eq 1 ]; then - core_backup=true - else - core_backup=false - fi - - config_file="$install_dir/Backup_list.conf" - cp "$install_dir/Backup_list.conf.default" "$config_file" - - ynh_replace_string --target_file="$config_file" --match_string="^backup_dir=.*" --replace_string="backup_dir=$data_dir/backup" - ynh_replace_string --target_file="$config_file" --match_string="^enc_backup_dir=.*" --replace_string="enc_backup_dir=$data_dir/encrypted_backup" - - ynh_replace_string --target_file="$config_file" --match_string="^encrypt=.*" --replace_string="encrypt=$encrypt" - ynh_replace_string --target_file="$config_file" --match_string="^cryptpass=.*" --replace_string="cryptpass=$passkey" - - ynh_replace_string --target_file="$config_file" --match_string="^ynh_core_backup=.*" --replace_string="ynh_core_backup=$core_backup" - - if [ $apps_backup -eq 1 ]; then - # Add all current applications to the backup - while read -r backup_app; do - ynh_replace_string --target_file="$config_file" --match_string="^ynh_app_backup=$" --replace_string="ynh_app_backup=$backup_app\n&" - done <<< "$(yunohost app list | grep 'id:' | sed 's/.*id: //')" - fi -fi - -# Calculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$config_file" - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Execution completed" --last