mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
redesigned return codes
This commit is contained in:
parent
2fbabe2de5
commit
593819e10b
24 changed files with 335 additions and 440 deletions
|
@ -12,9 +12,9 @@ is_cron_job_free() {
|
|||
check_job=$(grep "JOB='$job'" $V_USERS/$user/cron.conf)
|
||||
|
||||
if [ ! -z "$check_job" ]; then
|
||||
echo "Error: job exist"
|
||||
log_event 'debug' "$E_JOB_EXIST $V_EVENT"
|
||||
exit $E_JOB_EXIST
|
||||
echo "Error: job id exist"
|
||||
log_event 'debug' "$E_EXISTS $V_EVENT"
|
||||
exit $E_EXISTS
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -61,9 +61,9 @@ is_job_valid() {
|
|||
result=$(grep "JOB='$job'" $V_USERS/$user/cron.conf)
|
||||
|
||||
if [ -z "$result" ]; then
|
||||
echo "Error: job not exists"
|
||||
log_event 'debug' "$E_JOB_NOTEXIST $V_EVENT"
|
||||
exit $E_JOB_NOTEXIST
|
||||
echo "Error: job id not exists"
|
||||
log_event 'debug' "$E_NOTEXIST $V_EVENT"
|
||||
exit $E_NOTEXIST
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -80,8 +80,8 @@ is_job_suspended() {
|
|||
# Checkng key
|
||||
if [ ! -z "$str" ]; then
|
||||
echo "Error: job suspended"
|
||||
log_event 'debug' "$E_JOB_SUSPENDED $V_EVENT"
|
||||
exit $E_JOB_SUSPENDED
|
||||
log_event 'debug' "$E_SUSPENDED $V_EVENT"
|
||||
exit $E_SUSPENDED
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,8 @@ is_job_unsuspended() {
|
|||
# Checkng key
|
||||
if [ ! -z "$str" ]; then
|
||||
echo "Error: job unsuspended"
|
||||
log_event 'debug' "$E_JOB_UNSUSPENDED $V_EVENT"
|
||||
exit $E_JOB_UNSUSPENDED
|
||||
log_event 'debug' "$E_UNSUSPENDED $V_EVENT"
|
||||
exit $E_UNSUSPENDED
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue