From: Darshaka Pathirana Date: Wed, 24 Jun 2020 10:05:05 +0000 (+0200) Subject: zshrc: add function grml-remote-support X-Git-Tag: v0.17.3~1^2 X-Git-Url: https://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=d336df85259da98b36d8b4db20351e2b0448fd0f zshrc: add function grml-remote-support Provide a simple way to connect to the running Grml system via tmate by encoding the tmate ssh session in a QR code which can be scanned and sent to the remote support side. --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 231de8e..2690cfd 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -2817,6 +2817,17 @@ graphic chipset." return 1 } fi + + if check_com -c tmate && check_com -c qrencode ; then + function grml-remote-support() { + tmate -L grml-remote-support new -s grml-remote-support -d + tmate -L grml-remote-support wait tmate-ready + tmate -L grml-remote-support display -p '#{tmate_ssh}' | qrencode -t ANSI + echo "tmate session: $(tmate -L grml-remote-support display -p '#{tmate_ssh}')" + echo + echo "Scan this QR code and send it to your support team." + } + fi } # now run the functions