summaryrefslogtreecommitdiff
path: root/sh/u
blob: 7df27d95953f292a544a966b32d3081ab4516eb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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'
	o alacritty -T "$branch" -e ssh -t "$branch" '. "$HOME/.profile" &&' "upd $*;" '"$SHELL" -l'
done

upd