mirror of
https://github.com/YunoHost-Apps/archivist_ynh.git
synced 2024-09-03 18:15:55 +02:00
Panel-config + actions fully tested
This commit is contained in:
parent
ee8fd67827
commit
a878cd3515
9 changed files with 236 additions and 54 deletions
11
actions.json
11
actions.json
|
@ -19,4 +19,15 @@
|
||||||
"en": "Remove all previous backup files made by Archivist.",
|
"en": "Remove all previous backup files made by Archivist.",
|
||||||
"fr": "Supprime tout les précédents backups créés par Archivist."
|
"fr": "Supprime tout les précédents backups créés par Archivist."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "reset_default_config",
|
||||||
|
"name": "Reset the config file and restore a default one.",
|
||||||
|
"command": "/bin/bash scripts/actions/reset_default_config \"Backup_list.conf\"",
|
||||||
|
"user": "root",
|
||||||
|
"accepted_return_codes": [0],
|
||||||
|
"description": {
|
||||||
|
"en": "Reset the config file Backup_list.conf.",
|
||||||
|
"fr": "Réinitialise le fichier de configuration Backup_list.conf."
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
|
|
|
@ -53,6 +53,17 @@
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"default": 500
|
"default": 500
|
||||||
}]
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Overwriting config files",
|
||||||
|
"id": "overwrite_files",
|
||||||
|
"options": [{
|
||||||
|
"name": "Overwrite the cron file during the upgrade ?",
|
||||||
|
"help": "If the file is overwritten, a backup will be created.",
|
||||||
|
"id": "overwrite_cron",
|
||||||
|
"type": "bool",
|
||||||
|
"default": true
|
||||||
|
}]
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -30,6 +30,24 @@ IS_PACKAGE_CHECK () {
|
||||||
return $(env | grep -c container=lxc)
|
return $(env | grep -c container=lxc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BOOLEAN CONVERTER
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
bool_to_01 () {
|
||||||
|
local var="$1"
|
||||||
|
[ "$var" = "true" ] && var=1
|
||||||
|
[ "$var" = "false" ] && var=0
|
||||||
|
echo "$var"
|
||||||
|
}
|
||||||
|
|
||||||
|
bool_to_true_false () {
|
||||||
|
local var="$1"
|
||||||
|
[ "$var" = "1" ] && var=true
|
||||||
|
[ "$var" = "0" ] && var=false
|
||||||
|
echo "$var"
|
||||||
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -517,7 +535,7 @@ EOF
|
||||||
ynh_store_file_checksum "$finalfail2banjailconf"
|
ynh_store_file_checksum "$finalfail2banjailconf"
|
||||||
ynh_store_file_checksum "$finalfail2banfilterconf"
|
ynh_store_file_checksum "$finalfail2banfilterconf"
|
||||||
|
|
||||||
systemctl reload fail2ban
|
systemctl restart fail2ban
|
||||||
local fail2ban_error="$(journalctl -u fail2ban | tail -n50 | grep "WARNING.*$app.*")"
|
local fail2ban_error="$(journalctl -u fail2ban | tail -n50 | grep "WARNING.*$app.*")"
|
||||||
if [ -n "$fail2ban_error" ]
|
if [ -n "$fail2ban_error" ]
|
||||||
then
|
then
|
||||||
|
@ -532,7 +550,7 @@ EOF
|
||||||
ynh_remove_fail2ban_config () {
|
ynh_remove_fail2ban_config () {
|
||||||
ynh_secure_remove "/etc/fail2ban/jail.d/$app.conf"
|
ynh_secure_remove "/etc/fail2ban/jail.d/$app.conf"
|
||||||
ynh_secure_remove "/etc/fail2ban/filter.d/$app.conf"
|
ynh_secure_remove "/etc/fail2ban/filter.d/$app.conf"
|
||||||
systemctl reload fail2ban
|
systemctl restart fail2ban
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
|
||||||
# RETRIEVE ARGUMENTS
|
# RETRIEVE ARGUMENTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
app=$YNH_APP_ID
|
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
|
||||||
# RETRIEVE ARGUMENTS
|
# RETRIEVE ARGUMENTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
app=$YNH_APP_ID
|
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
|
|
||||||
|
|
82
scripts/actions/reset_default_config
Executable file
82
scripts/actions/reset_default_config
Executable file
|
@ -0,0 +1,82 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# GENERIC STARTING
|
||||||
|
#=================================================
|
||||||
|
# IMPORT GENERIC HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
source scripts/_common.sh
|
||||||
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RETRIEVE ARGUMENTS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
|
||||||
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
|
encrypt=$(ynh_app_setting_get $app encrypt)
|
||||||
|
core_backup=$(ynh_app_setting_get $app core_backup)
|
||||||
|
apps_backup=$(ynh_app_setting_get $app apps_backup)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SORT OUT THE CONFIG FILE TO HANDLE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
file="$1"
|
||||||
|
|
||||||
|
if [ "$file" = "Backup_list.conf" ]; then
|
||||||
|
config_file="$final_path/Backup_list.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SPECIFIC ACTION
|
||||||
|
#=================================================
|
||||||
|
# RESET THE CONFIG FILE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Verify the checksum and backup the file if it's different
|
||||||
|
ynh_backup_if_checksum_is_different "$config_file"
|
||||||
|
|
||||||
|
if [ "$file" = "Backup_list.conf" ]
|
||||||
|
then
|
||||||
|
# Get the default file and overwrite the current config
|
||||||
|
cp "$final_path/Backup_list.conf.default" "$config_file"
|
||||||
|
|
||||||
|
# Recreate the default config
|
||||||
|
backup_dir="/home/yunohost.app/${app}/backup"
|
||||||
|
enc_backup_dir="/home/yunohost.app/${app}/encrypted_backup"
|
||||||
|
ynh_replace_string "^backup_dir=.*" "backup_dir=$backup_dir" "$config_file"
|
||||||
|
ynh_replace_string "^enc_backup_dir=.*" "enc_backup_dir=$enc_backup_dir" "$config_file"
|
||||||
|
|
||||||
|
if [ $encrypt -eq 1 ]
|
||||||
|
then
|
||||||
|
encrypt=true
|
||||||
|
passkey="$final_path/passkey"
|
||||||
|
else
|
||||||
|
encrypt=false
|
||||||
|
passkey=na
|
||||||
|
fi
|
||||||
|
ynh_replace_string "^encrypt=.*" "encrypt=$encrypt" "$config_file"
|
||||||
|
ynh_replace_string "^cryptpass=.*" "cryptpass=$passkey" "$config_file"
|
||||||
|
|
||||||
|
if [ $core_backup -eq 1 ]
|
||||||
|
then
|
||||||
|
core_backup=true
|
||||||
|
else
|
||||||
|
core_backup=false
|
||||||
|
fi
|
||||||
|
ynh_replace_string "^ynh_core_backup=.*" "ynh_core_backup=$core_backup" "$config_file"
|
||||||
|
|
||||||
|
if [ $apps_backup -eq 1 ]
|
||||||
|
then
|
||||||
|
# Add all current applications to the backup
|
||||||
|
while read backup_app
|
||||||
|
do
|
||||||
|
ynh_replace_string "^ynh_app_backup=$" "ynh_app_backup=$backup_app\n&" "$config_file"
|
||||||
|
done <<< "$(yunohost app list -i | grep id: | sed 's/.*id: //')"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Calculate and store the config file checksum into the app settings
|
||||||
|
ynh_store_file_checksum "$config_file"
|
|
@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
|
||||||
# RETRIEVE ARGUMENTS
|
# RETRIEVE ARGUMENTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
app=$YNH_APP_ID
|
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
|
|
||||||
|
@ -36,36 +36,41 @@ get_config_value() {
|
||||||
# LOAD VALUES
|
# LOAD VALUES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Load the real value from the app config or elsewhere.
|
# Load the real value from the app config or elsewhere.
|
||||||
# Then get the value from the form.
|
# Then get the value from the form.
|
||||||
# If the form has a value for a variable, take the value from the form,
|
# If the form has a value for a variable, take the value from the form,
|
||||||
# Otherwise, keep the value from the app config.
|
# Otherwise, keep the value from the app config.
|
||||||
|
|
||||||
# Encryption
|
# Encryption
|
||||||
old_encrypt="$(get_config_value encrypt)"
|
old_encrypt="$(get_config_value encrypt)"
|
||||||
encrypt="${YNH_CONFIG_MAIN_ENCRYPTION_ENCRYPT:-$old_encrypt}"
|
encrypt="${YNH_CONFIG_MAIN_ENCRYPTION_ENCRYPT:-$old_encrypt}"
|
||||||
# Encryption password
|
# Encryption password
|
||||||
ynh_print_OFF
|
ynh_print_OFF
|
||||||
old_encrypt_password="$(cat $passkey)"
|
old_encrypt_password="$(cat $passkey)"
|
||||||
encrypt_password="${YNH_CONFIG_MAIN_ENCRYPTION_ENCRYPTION_PWD:-$old_encrypt_password}"
|
encrypt_password="${YNH_CONFIG_MAIN_ENCRYPTION_ENCRYPTION_PWD:-$old_encrypt_password}"
|
||||||
ynh_print_ON
|
ynh_print_ON
|
||||||
# ynh_core_backup
|
# ynh_core_backup
|
||||||
old_ynh_core_backup="$(get_config_value ynh_core_backup)"
|
old_ynh_core_backup="$(get_config_value ynh_core_backup)"
|
||||||
ynh_core_backup="${YNH_CONFIG_MAIN_BACKUP_TYPES_CORE_BACKUP:-$old_ynh_core_backup}"
|
ynh_core_backup="${YNH_CONFIG_MAIN_BACKUP_TYPES_CORE_BACKUP:-$old_ynh_core_backup}"
|
||||||
# ynh_app_backup
|
# ynh_app_backup
|
||||||
if [ -n "$(get_config_value ynh_app_backup)" ]
|
if [ -n "$(get_config_value ynh_app_backup)" ]
|
||||||
then
|
then
|
||||||
old_ynh_app_backup="true"
|
old_ynh_app_backup="true"
|
||||||
else
|
else
|
||||||
old_ynh_app_backup="false"
|
old_ynh_app_backup="false"
|
||||||
fi
|
fi
|
||||||
ynh_app_backup="${YNH_CONFIG_MAIN_BACKUP_TYPES_APPS_BACKUP:-$old_ynh_app_backup}"
|
ynh_app_backup="${YNH_CONFIG_MAIN_BACKUP_TYPES_APPS_BACKUP:-$old_ynh_app_backup}"
|
||||||
# Frequency
|
# Frequency
|
||||||
old_frequency="$(grep "^frequency: " "/etc/yunohost/apps/$app/settings.yml" | cut -d' ' -f2)"
|
old_frequency="$(grep "^frequency: " "/etc/yunohost/apps/$app/settings.yml" | cut -d' ' -f2)"
|
||||||
frequency="${YNH_CONFIG_MAIN_BACKUP_OPTIONS_FREQUENCY:-$old_frequency}"
|
frequency="${YNH_CONFIG_MAIN_BACKUP_OPTIONS_FREQUENCY:-$old_frequency}"
|
||||||
# Max size
|
# Max size
|
||||||
old_max_size="$(get_config_value max_size)"
|
old_max_size="$(get_config_value max_size)"
|
||||||
max_size="${YNH_CONFIG_MAIN_BACKUP_OPTIONS_MAX_SIZE:-$old_max_size}"
|
max_size="${YNH_CONFIG_MAIN_BACKUP_OPTIONS_MAX_SIZE:-$old_max_size}"
|
||||||
|
|
||||||
|
# Overwrite cron file
|
||||||
|
old_overwrite_cron="$(ynh_app_setting_get $app overwrite_cron)"
|
||||||
|
old_overwrite_cron=$(bool_to_true_false $old_overwrite_cron)
|
||||||
|
overwrite_cron="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_CRON:-$old_overwrite_cron}"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND
|
# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND
|
||||||
|
@ -82,6 +87,8 @@ show_config() {
|
||||||
|
|
||||||
echo "YNH_CONFIG_MAIN_BACKUP_OPTIONS_FREQUENCY=$frequency"
|
echo "YNH_CONFIG_MAIN_BACKUP_OPTIONS_FREQUENCY=$frequency"
|
||||||
echo "YNH_CONFIG_MAIN_BACKUP_OPTIONS_MAX_SIZE=$max_size"
|
echo "YNH_CONFIG_MAIN_BACKUP_OPTIONS_MAX_SIZE=$max_size"
|
||||||
|
|
||||||
|
echo "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_CRON=$overwrite_cron"
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -117,7 +124,8 @@ apply_config() {
|
||||||
ynh_print_info "Add a backup for the app $backup_app." >&2
|
ynh_print_info "Add a backup for the app $backup_app." >&2
|
||||||
ynh_replace_string "^ynh_app_backup=$" "ynh_app_backup=$backup_app\n&" "$config_file"
|
ynh_replace_string "^ynh_app_backup=$" "ynh_app_backup=$backup_app\n&" "$config_file"
|
||||||
done <<< "$(yunohost app list -i | grep id: | sed 's/.*id: //')"
|
done <<< "$(yunohost app list -i | grep id: | sed 's/.*id: //')"
|
||||||
else
|
elif [ "$ynh_app_backup" = "false" ] && [ "$old_ynh_app_backup" = "true" ]
|
||||||
|
then
|
||||||
# Remove all app currently backup
|
# Remove all app currently backup
|
||||||
# By deleting all line starting by 'ynh_app_backup=' and having something after '='
|
# By deleting all line starting by 'ynh_app_backup=' and having something after '='
|
||||||
sed -i "/^ynh_app_backup=.\+$/d" "$config_file"
|
sed -i "/^ynh_app_backup=.\+$/d" "$config_file"
|
||||||
|
@ -145,6 +153,10 @@ apply_config() {
|
||||||
|
|
||||||
# Change max_size in the config file
|
# Change max_size in the config file
|
||||||
ynh_replace_string "^max_size=.*" "max_size=$max_size" "$config_file"
|
ynh_replace_string "^max_size=.*" "max_size=$max_size" "$config_file"
|
||||||
|
|
||||||
|
# Set overwrite_cron
|
||||||
|
overwrite_cron=$(bool_to_01 $overwrite_cron)
|
||||||
|
ynh_app_setting_set $app overwrite_cron "$overwrite_cron"
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -46,6 +46,10 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_app_setting_set $app frequency "$frequency"
|
ynh_app_setting_set $app frequency "$frequency"
|
||||||
|
ynh_app_setting_set $app encrypt "$encrypt"
|
||||||
|
ynh_app_setting_set $app core_backup "$core_backup"
|
||||||
|
ynh_app_setting_set $app apps_backup "$apps_backup"
|
||||||
|
ynh_app_setting_set $app overwrite_cron "1"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
@ -118,6 +122,9 @@ then
|
||||||
done <<< "$(yunohost app list -i | grep id: | sed 's/.*id: //')"
|
done <<< "$(yunohost app list -i | grep id: | sed 's/.*id: //')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Calculate and store the config file checksum into the app settings
|
||||||
|
ynh_store_file_checksum "$config_file"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STRETCH COMPATIBILITY
|
# STRETCH COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -24,6 +24,10 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
frequency="$(ynh_app_setting_get $app frequency)"
|
frequency="$(ynh_app_setting_get $app frequency)"
|
||||||
|
encrypt=$(ynh_app_setting_get $app encrypt)
|
||||||
|
core_backup=$(ynh_app_setting_get $app core_backup)
|
||||||
|
apps_backup=$(ynh_app_setting_get $app apps_backup)
|
||||||
|
overwrite_cron=$(ynh_app_setting_get $app overwrite_cron)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -31,6 +35,39 @@ frequency="$(ynh_app_setting_get $app frequency)"
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# If encrypt doesn't exist, create it
|
||||||
|
if [ -z "$encrypt" ]; then
|
||||||
|
encrypt="$(grep "^encrypt=" "$final_path/Backup_list.conf" | cut -d= -f2)"
|
||||||
|
if [ "$encrypt" = true ]; then
|
||||||
|
encrypt=1
|
||||||
|
else
|
||||||
|
encrypt=0
|
||||||
|
fi
|
||||||
|
ynh_app_setting_set $app encrypt $encrypt
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If core_backup doesn't exist, create it
|
||||||
|
if [ -z "$core_backup" ]; then
|
||||||
|
core_backup="$(grep "^ynh_core_backup=" "$final_path/Backup_list.conf" | cut -d= -f2)"
|
||||||
|
ynh_app_setting_set $app core_backup $core_backup
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If apps_backup doesn't exist, create it
|
||||||
|
if [ -z "$apps_backup" ]; then
|
||||||
|
apps_backup="$(grep --count --max-count=1 "^ynh_app_backup=" "$final_path/Backup_list.conf")"
|
||||||
|
ynh_app_setting_set $app apps_backup $apps_backup
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If overwrite_cron doesn't exist, create it
|
||||||
|
if [ -z "$overwrite_cron" ]; then
|
||||||
|
overwrite_cron=1
|
||||||
|
ynh_app_setting_set $app overwrite_cron $overwrite_cron
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -72,27 +109,31 @@ fi
|
||||||
# UPDATE THE CRON FILE
|
# UPDATE THE CRON FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Verify the checksum and backup the file if it's different
|
# Overwrite the cron file only if it's allowed
|
||||||
ynh_backup_if_checksum_is_different "/etc/cron.d/$app"
|
if [ $overwrite_cron -eq 1 ]
|
||||||
|
then
|
||||||
|
# Verify the checksum and backup the file if it's different
|
||||||
|
ynh_backup_if_checksum_is_different "/etc/cron.d/$app"
|
||||||
|
|
||||||
cp ../conf/cron /etc/cron.d/$app
|
cp ../conf/cron /etc/cron.d/$app
|
||||||
ynh_replace_string "__FINALPATH__" "$final_path" /etc/cron.d/$app
|
ynh_replace_string "__FINALPATH__" "$final_path" /etc/cron.d/$app
|
||||||
ynh_replace_string "__APP__" "$app" /etc/cron.d/$app
|
ynh_replace_string "__APP__" "$app" /etc/cron.d/$app
|
||||||
if [ "$frequency" = "Daily" ]; then
|
if [ "$frequency" = "Daily" ]; then
|
||||||
cron_freq="0 2 * * *"
|
cron_freq="0 2 * * *"
|
||||||
elif [ "$frequency" = "Each 3 days" ]; then
|
elif [ "$frequency" = "Each 3 days" ]; then
|
||||||
cron_freq="0 2 */3 * *"
|
cron_freq="0 2 */3 * *"
|
||||||
elif [ "$frequency" = "Weekly" ]; then
|
elif [ "$frequency" = "Weekly" ]; then
|
||||||
cron_freq="0 2 * * 0"
|
cron_freq="0 2 * * 0"
|
||||||
elif [ "$frequency" = "Biweekly" ]; then
|
elif [ "$frequency" = "Biweekly" ]; then
|
||||||
cron_freq="0 2 * * 0/2"
|
cron_freq="0 2 * * 0/2"
|
||||||
else # Monthly
|
else # Monthly
|
||||||
cron_freq="0 2 1 * *"
|
cron_freq="0 2 1 * *"
|
||||||
|
fi
|
||||||
|
ynh_replace_string "__FREQUENCY__" "$cron_freq" /etc/cron.d/$app
|
||||||
|
|
||||||
|
# Recalculate and store the config file checksum into the app settings
|
||||||
|
ynh_store_file_checksum "/etc/cron.d/$app"
|
||||||
fi
|
fi
|
||||||
ynh_replace_string "__FREQUENCY__" "$cron_freq" /etc/cron.d/$app
|
|
||||||
|
|
||||||
# Recalculate and store the config file checksum into the app settings
|
|
||||||
ynh_store_file_checksum "/etc/cron.d/$app"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP LOGROTATE
|
# SETUP LOGROTATE
|
||||||
|
|
Loading…
Add table
Reference in a new issue