From 150301d1664be2a82efe2e2109e2e2d29f9cb810 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 11 Dec 2016 08:12:15 +0100 Subject: [PATCH] Tweaks and tweaks --- config/i3/config | 1 + config/i3/sshmenu | 6 +++++- scripts/machines.sh | 9 ++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/config/i3/config b/config/i3/config index 39e4332..b53f462 100644 --- a/config/i3/config +++ b/config/i3/config @@ -39,6 +39,7 @@ bindsym Mod1+F2 exec --no-startup-id ~/.config/i3/dmenu_run bindsym $mod+c exec --no-startup-id ~/.config/i3/passmenu bindsym $mod+asterisk exec --no-startup-id ~/.config/i3/sshmenu +bindsym $mod+dollar exec --no-startup-id ~/.config/i3/sshmenu root # start program launcher bindsym $mod+d exec --no-startup-id ~/.config/i3/dmenu_run diff --git a/config/i3/sshmenu b/config/i3/sshmenu index 15532fb..e384578 100755 --- a/config/i3/sshmenu +++ b/config/i3/sshmenu @@ -1,2 +1,6 @@ #!/bin/sh -xterm -e "ssh $(cat ~/.ssh/config | grep '^Host ' | cut -d ' ' -f 2 | grep -v '*' | sort | $HOME/.config/i3/dmenu_cmd -p 'SSH to ')" +if [ "$1" == 'root' ]; then + a=" (root)" + b="sudo " +fi +xterm -e "ssh $(cat ~/.ssh/config | grep '^Host ' | cut -d ' ' -f 2 | grep -v '*' | sort | $HOME/.config/i3/dmenu_cmd -p "SSH$a to ") -t '${b}bash --login'" diff --git a/scripts/machines.sh b/scripts/machines.sh index f5bea7c..8f4b240 100755 --- a/scripts/machines.sh +++ b/scripts/machines.sh @@ -130,7 +130,7 @@ function _machines-getAkey { # network } function _machines-updateAkey { - KEY_FILE=$(mktemp machines.XXXXXXXXXX.authorized_keys) + KEY_FILE=$(mktemp) network=$(cat $MACHINES_CONFIG/this | grep '^network=' | cut -d '=' -f 2) _machines-getAkey $network > $KEY_FILE if [ $? == 0 ]; then @@ -254,6 +254,13 @@ function machines-deleteNetwork { # network _machines-deleteElement $1 network } +function machines-updateAll { + machines-list | while read machine; do + echo "Updating $machine..." + ssh $machine 'machines-update' & + done +} + # USER FUNCTIONS function machines-update {