X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=tuerctlsh;fp=tuerctlsh;h=12dcde50a0fc612695951e7a5af4460abcfd7681;hb=d7a51a600e267777b556eb8836626fd004e48fd3;hp=3cadfcdb96daf1b97b6a36334dba0bcd20ec6ef8;hpb=cbba478c4eca3c3bf534492adb8ef889e2289dd7;p=svn42.git diff --git a/tuerctlsh b/tuerctlsh index 3cadfcd..12dcde5 100755 --- a/tuerctlsh +++ b/tuerctlsh @@ -1,8 +1,19 @@ -#!/bin/bash +#!/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 -sudo -u tuer /flash/tuer/tuer_socat.sh +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 -d $'\n'";,& " CMD #?"> " + CMD=(${=${${${CMD/;/ }/&/ }/\// }}) + ${(z)TUERCHAN} <<< "${CMD[1]} ssh $1" +fi +