Posted to openbsd by Bradipo at Wed Nov 30 21:28:49 GMT 2022view raw
- if tty >/dev/null
- then
- export DISPLAY=DISPLAY
- export SSH_ASKPASS="$0"
- set -- NOTASKPASS "$@"
- exec setsid "$0" "$@" </dev/null
- elif [ $# -gt 0 -a "$1" = "NOTASKPASS" ]
- then
- shift
- if [ $# -lt 3 ]; then echo "Usage: $0 script outputfile hostname"; exit 100; fi
- SCRIPT="$1"
- OUTPUT="$2"
- shift 2
- ssh -o PreferredAuthentications=password root@"$1" <"$SCRIPT" >"$OUTPUT" 2>&1
- else
- printf 'test123'
- fi