forked from thunix/ansible
Adding modlog tool
This commit is contained in:
parent
60000e52b7
commit
10af89505b
|
@ -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
|
|
@ -0,0 +1,9 @@
|
|||
# This deploys manually managed scripts
|
||||
---
|
||||
- name: Deploy modlog tool
|
||||
copy:
|
||||
src: ../files/usr/local/bin/modlog
|
||||
dest: /usr/local/bin/modlog
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
Loading…
Reference in New Issue