mirror of
https://github.com/serghey-rodin/vesta.git
synced 2024-12-11 06:40:47 -08:00
62 lines
1.5 KiB
Bash
Executable File
62 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: delete vesta autoupdate cron job
|
|
# options: NONE
|
|
#
|
|
# The function deletes vesta autoupdate cron job.
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument definition
|
|
user=admin
|
|
|
|
# Includes
|
|
source $VESTA/func/main.sh
|
|
source $VESTA/conf/vesta.conf
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
|
|
check_cron=$(grep 'v-update-sys-vesta-all' $USER_DATA/cron.conf)
|
|
if [ -z "$check_cron" ]; then
|
|
exit
|
|
fi
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
# Deleting job
|
|
job=$(echo $check_cron|tr ' ' "\n"|grep JOB|cut -f 2 -d "'")
|
|
sed -i "/JOB='$job' /d" $USER_DATA/cron.conf
|
|
|
|
# Sorting jobs by id
|
|
sort_cron_jobs
|
|
|
|
# Sync system cron with user
|
|
sync_cron_jobs
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
# Decreasing cron value
|
|
decrease_user_value "$user" '$U_CRON_JOBS'
|
|
|
|
# Restarting crond
|
|
$BIN/v-restart-cron
|
|
check_result $? "Cron restart failed" >/dev/null
|
|
|
|
# Logging
|
|
log_event "$OK" "$ARGUMENTS"
|
|
|
|
exit
|