#!/bin/zsh # # make this the default shell for user tuerctl and add # the following line to sudoers file: # # tuerctl ALL=(tuer) NOPASSWD: /flash/tuer/tuer_socat.sh setopt histsubstpattern local TUERCHAN="sudo -u tuer /flash/tuer/tuer_socat.sh" [[ $1 == "-c" ]] && shift if [[ -z $1 ]]; then ${(z)TUERCHAN} else echo "Usable commands are: open, close, toggle, reset, status" read -A CMD ${(z)TUERCHAN} <<< "${${CMD[1]}:gs/[^a-zA-Z]//} ssh $1" fi