File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # info: adds an event to the appropriate log
3+ # options: LOG_TYPE USER
4+
5+ # Argument definition
6+ log_type=$1
7+ event_type=$2
8+ user=$3
9+ message=$4
10+
11+ # Includes
12+ source $HESTIA /func/main.sh
13+ source $HESTIA /conf/hestia.conf
14+
15+ # ----------------------------------------------------------#
16+ # Verifications #
17+ # ----------------------------------------------------------#
18+
19+ check_args ' 4' " $# " ' LOG_TYPE EVENT_TYPE USER MESSAGE'
20+ is_format_valid ' user' ' ip'
21+ is_object_valid ' user' ' USER' " $user "
22+
23+ # Generating timestamp
24+ time_n_date=$( date +' %T %F' )
25+ time=$( echo " $time_n_date " | cut -f 1 -d \ )
26+ date=$( echo " $time_n_date " | cut -f 2 -d \ )
27+
28+
29+ # ----------------------------------------------------------#
30+ # Action #
31+ # ----------------------------------------------------------#
32+
33+
34+
35+
36+
37+ # ----------------------------------------------------------#
38+ # Hestia #
39+ # ----------------------------------------------------------#
40+
41+ exit
You can’t perform that action at this time.
0 commit comments