diff options
author | momo <momo+github@mo2-systems.com> | 2011-09-23 17:26:45 +0200 |
---|---|---|
committer | momo <momo+github@mo2-systems.com> | 2011-09-23 17:26:45 +0200 |
commit | 77ba054b1e3a55a54f4643bc544e7c3550006a00 (patch) | |
tree | cf8e32449eb204b4926b0f145e26b54cdb595c6b /god/licht | |
parent | cc74c033c19db59069f9bb5e12670e9916eadcf9 (diff) |
//god/licht: minor code improvements
Diffstat (limited to 'god/licht')
-rwxr-xr-x | god/licht | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -13,9 +13,11 @@ # ghetto - toggles the lights in the hallway # 0-7 - toggles individual lights +TOGGLE=`echo "$2" | sed -n '/^[0-1]/p'` + 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'` + #TOGGLE=`echo "$2" | sed -n '/^[0-1]/p'` if ! [ "$LAMPE" -a "$TOGGLE" ];then echo "you are made of stupid" exit 1 @@ -76,38 +78,30 @@ case "$1" in echo "Usage: lich <lampe> <0/1>" ;; all) - TOGGLE=$2 toggle_all ;; kuschel) - TOGGLE=$2 kuschel ;; software) - TOGGLE=$2 software ;; links) - TOGGLE=$2 kuschel software ;; rechts) - TOGGLE=$2 tische porsche ghetto ;; tische) - TOGGLE=$2 tische ;; porsche) - TOGGLE=$2 porsche ;; ghetto) - TOGGLE=$2 ghetto ;; *) |