X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=83721fc80fe6a20d9d0daee14de886149ed8b546;hb=ae96136375d4c36c4b6845bbf1975695ccc4b844;hp=f2793e888dcc334ad8899f1a9656a893abea1550;hpb=8d29de95be2b44cac6e2cc3d0643f542be05e4bd;p=distro-setup diff --git a/brc b/brc index f2793e8..83721fc 100644 --- a/brc +++ b/brc @@ -666,10 +666,17 @@ khcopy() { # ya, hacky hardcoded hostnames in 2023. we could do better hssh-update() { + local -a failed_hosts for host in kd x3.office.fsf.org syw; do e $host - scp /b/fai/fai/config/files/usr/local/bin/hssh/IANK root@$host:/usr/local/bin/hssh + if ! scp /b/fai/fai/config/files/usr/local/bin/hssh/IANK root@$host:/usr/local/bin/hssh; then + failed_hosts+=($host) + fi done + if (( ${#failed_hosts[@]} >= 1 )); then + echo failed_hosts=${failed_hosts[*]} + return 1 + fi } a() { @@ -1055,6 +1062,10 @@ etail2() { } ccomp tail etail etail2 +# ran into this online, trying it out +detach() { + ( "$@" &>/dev/null & disown ) +} showkeys() { ssh "$@" cat .ssh/authorized_keys{,2} @@ -1422,9 +1433,12 @@ re() { grr -m 5 "$@" } -hr() { # horizontal row. used to break up output - printf "$(tput setaf 5 2>/dev/null ||:)█$(tput sgr0 2>/dev/null||:)%.0s" $(eval echo "{1..${COLUMNS:-60}}") - echo +# horizontal row. used to break up output +hr() { + local blocks + # 180 is long enough. + blocks=██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + printf "%s\n" "$(tput setaf 5 2>/dev/null ||:)${blocks:0:${COLUMNS:-180}}$(tput sgr0 2>/dev/null||:)" } # highlight hl() { @@ -1660,7 +1674,7 @@ ksu() { # history search unique histrm() { history -n HISTTIMEFORMAT= history | awk -v IGNORECASE=1 '{ a=$1; sub(/^ *[^ ]+ */, "") }; /'"$*"'/' - read -p "press anything but contrl-c to delete" + read -r -p "press anything but contrl-c to delete" for entry in $(HISTTIMEFORMAT= history | awk -v IGNORECASE=1 '{ a=$1; sub(/^ *[^ ]+ */, "") }; /'"$*"'/ { print a }' | tac); do history -d $entry done