Created
August 1, 2019 17:07
-
-
Save luc-tielen/8c359dc01e3916d918e7a2ca459e4ce1 to your computer and use it in GitHub Desktop.
Bash: run command passed via args on incoming connection
This file contains hidden or 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 | |
nc -z 127.0.0.1 8421 &> /dev/null |
This file contains hidden or 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 | |
# Usage: ./server.sh echo "hello world!" | |
while nc -l 127.0.0.1 8421; do | |
eval "$@" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment