Created
April 23, 2016 17:48
-
-
Save awilliams000/98d01d7e8d1d875b12c1ac523774188f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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