diff options
Diffstat (limited to 'god')
| -rwxr-xr-x | god/licht | 37 | 
1 files changed, 30 insertions, 7 deletions
| @@ -14,18 +14,39 @@  #   0-7         -    toggles individual lights  TOGGLE=`echo "$2" | sed -n '/^[0-1]/p'`  +shorthelp() { +      echo  "Usage: $0 [OPTIONS] [0|1]" +      echo  "Toggle the lights in the shack." +} +longhelp(){ +  shorthelp + +cat <<EOF + +OPTIONS +   all         -    toggles all lights +   links       -    toggles all lights on the left hand side while looking towards the Auditorium +   rechts      -    toggles all lights on the right hand side while looking towards the Auditorium +   kuschel     -    toggles the lights in the pwnie corner +   software    -    toggles the software corner +   tische      -    toggles the lights on the window side of the long table +   porsche     -    toggles the lights on the window side where the porsche cockpit is +   ghetto      -    toggles the lights in the hallway +   0-7         -    toggles individual lights +EOF +}  toggle() {    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 +    longhelp +    exit 1    fi    STRING="\\xA5\\x5A\\x$LAMPE\\x$TOGGLE"    if [ $# != 2 ]    then -     echo "Usage: licht <lampe> <0/1>" +    longhelp +    exit 1    else      echo "Toggle light $LAMPE ($TOGGLE)"        printf "$STRING" | nc -u -w1 licht.shack 1337 @@ -73,9 +94,11 @@ porsche(){  }  case "$1" in -  --help)  -      echo "Toggle the lights" -      echo "Usage: lich <lampe> <0/1>" +  (--help)  +    if [ "$2" == "--verbose" ] +    then longhelp +    else shorthelp +    fi        ;;    all)         toggle_all | 
