mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 21:34:12 -07:00
refactoring: log_event(), is_format_valid()
This commit is contained in:
parent
6e0ef668bb
commit
e05dca61a6
211 changed files with 756 additions and 1091 deletions
|
@ -20,7 +20,7 @@ source $VESTA/conf/vesta.conf
|
|||
is_file_available() {
|
||||
if [ ! -e "$vfile" ]; then
|
||||
echo "Error: file $vfile doesn't exist"
|
||||
log_event "$E_NOTEXIST" "$EVENT"
|
||||
log_event "$E_NOTEXIST" "$ARGUMENTS"
|
||||
exit $E_NOTEXIST
|
||||
fi
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ is_file_valid() {
|
|||
vcontent=$(cat $vfile)
|
||||
if [[ "$vcontent" =~ $exclude ]]; then
|
||||
echo "Error: invalid characters in the exlusion list"
|
||||
log_event "$E_INVALID" "$EVENT"
|
||||
log_event "$E_INVALID" "$ARGUMENTS"
|
||||
exit $E_INVALID
|
||||
fi
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ is_file_valid() {
|
|||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'USER FILE'
|
||||
validate_format 'user' 'vfile'
|
||||
is_format_valid 'user' 'vfile'
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_file_available
|
||||
is_file_valid
|
||||
|
@ -78,6 +78,6 @@ chmod 660 $USER_DATA/backup-excludes.conf
|
|||
|
||||
# Logging
|
||||
log_history "updated exlusion list"
|
||||
log_event "$OK" "$EVENT"
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue