Skip to content

Instantly share code, notes, and snippets.

@LoicMahieu
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save LoicMahieu/49e07e25f9ec12e9d94a to your computer and use it in GitHub Desktop.

Select an option

Save LoicMahieu/49e07e25f9ec12e9d94a to your computer and use it in GitHub Desktop.
Monit wrapper
#!/bin/bash
function print {
echo "[$(date)] MONIT-WRAPPER: $1"
}
{
print "Env variables"
env
print "Command: $*"
$@
R=$?
print "Exit code $R"
} >> /var/log/monit.log 2>&1
exit $R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment