Skip to content

Instantly share code, notes, and snippets.

@mnstrspeed
Last active August 29, 2015 14:16
Show Gist options
  • Save mnstrspeed/e032c26f7fbd4f36c687 to your computer and use it in GitHub Desktop.
Save mnstrspeed/e032c26f7fbd4f36c687 to your computer and use it in GitHub Desktop.
events
mkdir /etc/event
curl -s https://gist.githubusercontent.com/mnstrspeed/e032c26f7fbd4f36c687/raw/b4c9977f5522e32a810b6e1d5514cdfef46f158c/trigger > /etc/event/trigger
chmod +x /etc/event/trigger
ln -s /etc/event/trigger /usr/bin/trigger
#! /bin/sh
if [ ! -z "$1" ]
then
if [ -d "/etc/events/$1" ]
then
for hook in /etc/events/$1/*
do
exec "$hook" &> /dev/null &
done
fi
else
echo "Usage: trigger <event>"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment