Skip to content

Instantly share code, notes, and snippets.

@awilliams000
Created April 23, 2016 17:48
Show Gist options
  • Save awilliams000/98d01d7e8d1d875b12c1ac523774188f to your computer and use it in GitHub Desktop.
Save awilliams000/98d01d7e8d1d875b12c1ac523774188f to your computer and use it in GitHub Desktop.
#!/bin/bash
DEFAULT_PIPE_NAME=".plumber"
PIPE_NAME="${1:-$DEFAULT_PIPE_NAME}"
if [ ! -p $PIPE_NAME ]; then
echo "Created pipe ${PIPE_NAME}..."
mkfifo $PIPE_NAME
fi
echo "Waiting for commands!"
while true; do
COMMAND=$(cat $PIPE_NAME)
echo Running ${COMMAND}...
sh -c "$COMMAND"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment