Svdrpsend.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
K |
Version vom 19. April 2008, 09:02 Uhr
Erster Versuch, ohne perl.
#!/bin/sh
trap 'exec 5>&-' 2 15
while [ $# != 0 ] ; do
case $1 in
-d) HOST="$2" ;;
-p) PORT="$2" ;;
*) ARGS=$ARGS" $1" ;;
esac
shift
done
test -n "$ARGS" || \
(
echo "Usage: $0 options command..."
echo "Options: -d hostname destination hostname (default: localhost)"
echo " -p port SVDRP port number (default: 2001)"
exit
)
# Your BASH have to be compiled with /dev/tcp/ support!
exec 5<>/dev/tcp/${HOST:-localhost}/${PORT:-2001} || exit
echo "$ARGS" >&5
cat <&5