X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/fae90a2a15dde4a7472a5353857f1497c63e00db..26ffc95f66633e04e63ddce54c6161c5ce80b6b7:/.zsh/func/idiotheke diff --git a/.zsh/func/idiotheke b/.zsh/func/idiotheke deleted file mode 100755 index 5a0d5d6..0000000 --- a/.zsh/func/idiotheke +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -set -u - -if [ -n "${ZSH_VERSION:-}" ]; then - # don't execute trap on return from functions - setopt local_options posix_traps no_warn_create_global -fi - -RESOURCE=idiotheke.de -PASSWORD="$(pass $RESOURCE)" -LOGIN="$(echo "$PASSWORD" | sed -rne 's/login: //p')" -URL="$(echo "$PASSWORD" | sed -rne 's/url: //p')" -PASSWORD="${PASSWORD%% -*}" #first line only - -if [ -n "${1:-}" ]; then - ASKPASS="$(tempfile --prefix=askpass --mode=700)" - cleanup() { rm -f $ASKPASS; trap - 0; } - trap cleanup 0 - - echo '#!/bin/sh' >> $ASKPASS - echo "echo ${LOGIN}:${PASSWORD}" >> $ASKPASS - - wget --continue --use-askpass="$ASKPASS" "$@" - - cleanup - ! command -v unfunction >/dev/null || unfunction cleanup -else - LFTP_PASSWORD="$PASSWORD" lftp -e "open -u $LOGIN --env-password $URL" -fi - -unset RESOURCE LOGIN PASSWORD URL ASKPASS