X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=d359f6535415300e9fe9746514261b2d95150645;hb=87c3f2244a47ad10a031a27d0d0456f0a7defd21;hp=0745bffee49d2a6f66e484064cee697bb914cff6;hpb=ca61084446e48fb0703ce2a203c1bd18ceaf4dfb;p=distro-setup diff --git a/brc b/brc index 0745bff..d359f65 100644 --- a/brc +++ b/brc @@ -354,6 +354,7 @@ mysrc() { mysrc /a/bin/small-misc-bash/ll-function mysrc /a/bin/distro-functions/src/package-manager-abstractions +mysrc /a/bin/fai/fai/config/distro-install-common/bash-misc-funcs # things to remember: # ALT-C - cd into the selected directory @@ -2964,33 +2965,6 @@ nonet() { m() { printf "%s\n" "$*"; "$@"; } m2() { printf "%s\n" "$*" >&2; "$@"; } -# update file. note: duplicated in mail-setup. -# updates $ur u result to true or false -# updates $reload to true if file updated is in /etc/systemd/system -u() { - local tmp tmpdir dest="$1" - local base="${dest##*/}" - local dir="${dest%/*}" - if [[ $dir != "$base" ]]; then - # dest has a directory component - mkdir -p "$dir" - fi - # shellcheck disable=SC2034 # see comment at top of function - ur=false # u result - tmpdir="$(mktemp -d)" - cat >$tmpdir/"$base" - tmp=$(rsync -ic $tmpdir/"$base" "$dest") - if [[ $tmp ]]; then - printf "%s\n" "$tmp" - # shellcheck disable=SC2034 # see comment at top of function - ur=true - if [[ $dest == /etc/systemd/system/* ]]; then - # shellcheck disable=SC2034 # see comment at top of function - reload=true - fi - fi - rm -rf $tmpdir -} uptime() {