#!/bin/sh # temporary solution before rewriting upd anc cfg to be better and more automated ssh-add -l || ssh-add #for branch in $(git -C "$HOME/programs/config_local_arch" branch | awk '!/master/{print ($1=="*")?$2:$1}'); do git -C "$HOME/programs/config_local_arch" branch | awk '!/master/{print ($1=="*")?$2:$1}' | while read -r branch; do # alacritty use -T to change window name so I can identify different servers # need to invoke bash afterwards for manual things like reboot if linux upgrades and pacdiff # maybe can automate further so no need manual things # need `bash -l` to invoke as login shell, so no need source .profile and inputrc/readline also works # https://superuser.com/questions/306530/run-remote-ssh-command-with-full-login-shell # maybe another way: # https://superuser.com/questions/241187/how-do-i-reload-inputrc # because I invoke bash, no need alacritty --hold o alacritty -T "$branch" -e ssh -t "$branch" '. "$HOME/.profile" && upd; "$SHELL" -l' done upd