replaced underscore with dash in api syscalls

This commit is contained in:
Serghey Rodin 2012-11-09 18:26:32 +02:00
commit b6b7eacadb
283 changed files with 438 additions and 412 deletions

62
bin/v-delete-cron-job Executable file
View file

@ -0,0 +1,62 @@
#!/bin/bash
# info: delete cron job
# options: user job
#
# The function deletes cron job.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
job=$2
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'user job'
validate_format 'user' 'job'
is_system_enabled "$CRON_SYSTEM"
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
is_object_valid 'cron' 'JOB' "$job"
is_object_unsuspended 'cron' 'JOB' "$job"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Deleting job
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'
# Restart crond
$BIN/v-restart-cron "$EVENT"
# Logging
log_history "deleted cron job $job"
log_event "$OK" "$EVENT"
exit