| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/bin/bash
- # info: Delete auth log file for user
- #
- # The function for deleting a users auth log file
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument definition
- user=$1
- # Includes
- # shellcheck source=/usr/local/hestia/func/main.sh
- source $HESTIA/func/main.sh
- # shellcheck source=/usr/local/hestia/conf/hestia.conf
- source $HESTIA/conf/hestia.conf
- # Perform verification if read-only mode is enabled
- check_hestia_demo_mode
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- check_args '1' "$#" 'USER'
- is_format_valid 'user'
- is_object_valid 'user' 'USER' "$user"
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Remove log file and log event
- if [ -f $USER_DATA/auth.log ]; then
- rm -f $USER_DATA/auth.log
- log_history "login history for $user was cleared."
- log_event "$OK" "$ARGUMENTS"
- fi
- exit
|