Created
December 27, 2015 07:34
-
-
Save kevinmeziere/7ab712bf3274ae76e439 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
main() { | |
for CONF in `find /opt/local/fifo*/etc -name "*.conf"` | |
do | |
cat "$CONF" | grep -v "distributed_cookie" > "$CONF".tmp | |
transfer "$CONF".tmp | |
done | |
}; | |
transfer() { | |
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --silent --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --silent --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }; | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment