tuerctlsh improved
[svn42.git] / tuerctlsh
1 #!/bin/zsh
2 #
3 # make this the default shell for user tuerctl and add 
4 # the following line to sudoers file:
5 #
6 # tuerctl ALL=(tuer) NOPASSWD: /flash/tuer/tuer_socat.sh
7
8 setopt histsubstpattern
9 local TUERCHAN="sudo -u tuer /flash/tuer/tuer_socat.sh"
10
11 [[ $1 == "-c" ]] && shift
12 if [[ -z $1 ]]; then
13   ${(z)TUERCHAN}
14 else
15   echo "Usable commands are: open, close, toggle, reset, status"
16   read -A CMD
17   ${(z)TUERCHAN} <<< "${${CMD[1]}:gs/[^a-zA-Z]//} ssh $1"
18 fi
19