Adding simple modlog

This commit is contained in:
Ubergeek 2019-11-14 02:27:57 +00:00
parent a4f9b6b9ac
commit 52e7726ba9
1 changed files with 34 additions and 0 deletions

34
modlog Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
################################################################################
#
# $0 is a tool that logs mod actions
#
# Arguments:
# {action}
#
# Return codes:
# 0 Exectuted without problem
# 1 Incorrect usage pattern.
#
# This software is licensed under the AGPL 3.0 or later, by
# ubergeek <ubergeek@thunix.net>
#
################################################################################
ACTION=$*
function usage() {
cat << _EOF
$0 {action}
{action} Free form text of what action was performed.
_EOF
}
if [ "$1" == "" ]; then
usage
exit 0
fi
echo -e `date`"\t"`whoami`"\t"$ACTION | sudo tee -a /root/modlog