diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-02-02 23:11:57 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-02-03 12:25:33 -0700 |
commit | 14e50c6515a163c6d7894b0ca4133f15d7cf7c42 (patch) | |
tree | fbe6808f465f4cb38cc1afa00f9a8a30f5582dfd /archive | |
parent | c61812b3a2aff29c54c2ce671d566d7a41c7689a (diff) | |
download | dotfiles-14e50c6515a163c6d7894b0ca4133f15d7cf7c42.tar.gz |
replace wofi_ssh_lxc with something smarter
Diffstat (limited to 'archive')
-rwxr-xr-x | archive/scripts/desktop/wofi_ssh_lxc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/archive/scripts/desktop/wofi_ssh_lxc b/archive/scripts/desktop/wofi_ssh_lxc new file mode 100755 index 00000000..41a296a8 --- /dev/null +++ b/archive/scripts/desktop/wofi_ssh_lxc @@ -0,0 +1,17 @@ +#!/bin/bash + +# for connecting to athenet LXCs which don't have ssh daemons + +container=$(wofi --dmenu -p "name of container") +test -n "$container" || exit 0 +if [[ $container != *.* ]]; then + container="$container.silentflame.com" +fi + +host=$(perl -wlne'/^Host\s+(\S+)/ and !/\*/ and print $1' $HOME/.ssh/config \ + | wofi --dmenu -p "container's host" "$@") + +if [ -n "$host" -a -n "$container" ]; then + foot ssh-and-tmux "$host" --container-name="${container}" \ + --container-cmd="lxc-unpriv-attach -n %s --keep-var TERM --clear-env -vHOME=/root" +fi |