blob: 2b05b9f3cab69e37f729518ad3d747306f9dbd3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/bin/bash
LAMPE=`echo $1 | sed -n '/^[1-2]*[0-9]*[0-9]$/p' | xargs echo "obase=16;" | bc`
TOGGLE=`echo $2 | sed -n '/^[0-1]$/p'`
if ! [ "$LAMPE" -a "$TOGGLE" ];then
echo "you are made of stupid"
exit 1
fi
STRING="\xA5\x5A\x$LAMPE\x$TOGGLE"
if [ $# != 2 ]
then
echo -ne "Usage: licht <lampe> <0/1>"
else
echo "$LAMPE$TOGGLE"
echo -ne "$STRING" | nc -u -w1 licht.shack 1337
fi
|