File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # info: Delete log file for user
3+ #
4+ # The function for deleting a users log file
5+
6+ # ----------------------------------------------------------#
7+ # Variable&Function #
8+ # ----------------------------------------------------------#
9+
10+ # Argument definition
11+ user=$1
12+ date=$( date " +%F %T" )
13+
14+ # Includes
15+ source $HESTIA /func/main.sh
16+ source $HESTIA /conf/hestia.conf
17+
18+ # ----------------------------------------------------------#
19+ # Action #
20+ # ----------------------------------------------------------#
21+
22+ # Remove log file
23+ if [ -z $user ]; then
24+ echo " Error: no user specified."
25+ elif [ ! -f " $HESTIA /data/users/$user /history.log" ]; then
26+ echo " Error: no history log found for $user ."
27+ else
28+ rm -f $HESTIA /data/users/$user /history.log
29+ fi
30+
31+ log_history " ======== Log for $user cleared on $date ========"
32+ log_event " $OK " " $ARGUMENTS "
33+
34+ exit
You can’t perform that action at this time.
0 commit comments