Просмотр исходного кода

Minor fixes to v-*-cron-hestia-autoupdate

* Remove duplicate demo mode check
* Prevent an issue where cron job counter would fall out of sync after updates enabled/disabled.
Kristan Kenney 5 лет назад
Родитель
Сommit
16b7f1c97e
2 измененных файлов с 2 добавлено и 7 удалено
  1. 1 7
      bin/v-add-cron-hestia-autoupdate
  2. 1 0
      bin/v-delete-cron-hestia-autoupdate

+ 1 - 7
bin/v-add-cron-hestia-autoupdate

@@ -44,9 +44,6 @@ time_n_date=$(date +'%T %F')
 time=$(echo "$time_n_date" |cut -f 1 -d \ )
 time=$(echo "$time_n_date" |cut -f 1 -d \ )
 date=$(echo "$time_n_date" |cut -f 2 -d \ )
 date=$(echo "$time_n_date" |cut -f 2 -d \ )
 
 
-# Remove existing cron job
-$BIN/v-delete-cron-hestia-autoupdate
-
 # Define time somewhere at night
 # Define time somewhere at night
 if [ -z "$mode" ] || [ "$mode" = "apt" ]; then
 if [ -z "$mode" ] || [ "$mode" = "apt" ]; then
     min=$(generate_password '012345' '2')
     min=$(generate_password '012345' '2')
@@ -82,9 +79,6 @@ sort_cron_jobs
 # Sync cronjobs with system crond
 # Sync cronjobs with system crond
 sync_cron_jobs
 sync_cron_jobs
 
 
-# Perform verification if read-only mode is enabled
-check_hestia_demo_mode
-
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Hestia                             #
 #                       Hestia                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -97,7 +91,7 @@ $BIN/v-restart-cron
 check_result $? "Cron restart failed" >/dev/null
 check_result $? "Cron restart failed" >/dev/null
 
 
 # Logging
 # Logging
-log_history "added cron job $job"
+log_history "enabled automatic updates"
 log_event "$OK" "$ARGUMENTS"
 log_event "$OK" "$ARGUMENTS"
 
 
 exit
 exit

+ 1 - 0
bin/v-delete-cron-hestia-autoupdate

@@ -63,6 +63,7 @@ $BIN/v-restart-cron
 check_result $? "Cron restart failed" >/dev/null
 check_result $? "Cron restart failed" >/dev/null
 
 
 # Logging
 # Logging
+log_history "disabled automatic updates"
 log_event "$OK" "$ARGUMENTS"
 log_event "$OK" "$ARGUMENTS"
 
 
 exit
 exit