25 lines
385 B
Bash
Executable file
25 lines
385 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# check for filter string
|
|
while getopts "f:" opt; do
|
|
case "$opt" in
|
|
f)
|
|
filter="$OPTARG"
|
|
;;
|
|
\?)
|
|
echo "Invalid option"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ -z "$filter" ]; then
|
|
echo "No filter!"
|
|
exit 1
|
|
fi
|
|
|
|
tempdir="$(mktemp -d kakpipe-XXXXXX)"
|
|
fifo="${tempdir}/fifo"
|
|
|
|
# cleanup
|
|
rm -r "$tempdir"
|