aboutsummaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/ssh-askpass14
-rwxr-xr-x.local/bin/ssh-askpass.sh16
2 files changed, 16 insertions, 14 deletions
diff --git a/.local/bin/ssh-askpass b/.local/bin/ssh-askpass
deleted file mode 100755
index d3bbc91..0000000
--- a/.local/bin/ssh-askpass
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-# Remember to export SSH_ASKPASS=~/.local/bin/ssh-askpass in your .bashrc
-RESULT=$(pinentry-curses --ttytype=xterm-color --lc-ctype=en_US.UTF8 --ttyname=/dev/tty <<END | grep -E '^(D|ERR)'
-SETDESC Enter your SSH password:
-SETPROMPT
-GETPIN
-END
-)
-
-if [ "$RESULT" == "ERR 111 canceled" ]; then
- exit 255
-else
- echo ${RESULT:2:${#RESULT}-2}
-fi
diff --git a/.local/bin/ssh-askpass.sh b/.local/bin/ssh-askpass.sh
new file mode 100755
index 0000000..879a882
--- /dev/null
+++ b/.local/bin/ssh-askpass.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Remember to export SSH_ASKPASS=~/.local/bin/ssh-askpass.sh
+RESULT=$(pinentry-curses --ttytype=xterm-color --lc-ctype=en_US.UTF8 --ttyname=/dev/tty <<END | grep -E '^(D|ERR)'
+SETDESC Enter your SSH password:
+SETPROMPT
+GETPIN
+END
+)
+
+if [ "$RESULT" = "ERR 111 canceled" ]; then
+ exit 255
+else
+ length=$(printf "%s" "$RESULT" | wc -c)
+ length=$((length))
+ echo "$RESULT" : '..' | cut -c 3-"$length"
+fi