projects
/
svn42.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cbba478
)
tuerctlsh for everyone
author
Bernhard Tittelbach
<xro@realraum.at>
Wed, 4 Sep 2013 10:52:03 +0000
(10:52 +0000)
committer
Bernhard Tittelbach
<xro@realraum.at>
Wed, 4 Sep 2013 10:52:03 +0000
(10:52 +0000)
tuerctlsh
patch
|
blob
|
history
diff --git
a/tuerctlsh
b/tuerctlsh
index
3cadfcd
..
12dcde5
100755
(executable)
--- 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
#
# 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
+