From 52e7726ba96eec55ca61e45c1d7f88c52792ebf6 Mon Sep 17 00:00:00 2001 From: Ubergeek Date: Thu, 14 Nov 2019 02:27:57 +0000 Subject: [PATCH] Adding simple modlog --- modlog | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 modlog diff --git a/modlog b/modlog new file mode 100755 index 0000000..0aa6104 --- /dev/null +++ b/modlog @@ -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 +# +################################################################################ + +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