From 742ca66569dd031fdb86de67ecef9305e24fbb49 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 23 Sep 2024 20:23:48 -0400 Subject: [PATCH] minor fix and improvements --- brc | 2 +- dynamic-ip-update | 4 ++-- filesystem/usr/local/bin/git | 34 ++++++++++++++++++++++++++++++++++ system-status | 4 ++-- 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100755 filesystem/usr/local/bin/git diff --git a/brc b/brc index acf2950..8ee018f 100644 --- a/brc +++ b/brc @@ -2286,7 +2286,7 @@ profsrc() { prof() { command prof &>/dev/null & } -# self chat. chatlog messages to myself. +# self chat. record messages to myself. sc() { while read -r l; do printf '\033[1A\033[K'; printf "%s\n" "$l"| ts "%F %T" | tee -a /p/self-chat.log diff --git a/dynamic-ip-update b/dynamic-ip-update index 3d36363..d524718 100755 --- a/dynamic-ip-update +++ b/dynamic-ip-update @@ -206,9 +206,9 @@ answer quit EOF - chronic nsupdate $ip_arg -k /p/c/machine_specific/vps/filesystem/etc/bind/Kb8.nz.*.private <$tmpf || nsupdate_fails=$((nsupdate_fails + 1)) + chronic nsupdate $ip_arg -k /p/c/user_specific/bind/etc/bind/Kb8.nz.*.private <$tmpf || nsupdate_fails=$((nsupdate_fails + 1)) sed -i 's/^server .*/server bk.b8.nz/' $tmpf - chronic nsupdate $ip_arg -k /p/c/machine_specific/vps/filesystem/etc/bind/Kb8.nz.*.private <$tmpf || nsupdate_fails=$((nsupdate_fails + 1)) + chronic nsupdate $ip_arg -k /p/c/user_specific/bind/etc/bind/Kb8.nz.*.private <$tmpf || nsupdate_fails=$((nsupdate_fails + 1)) if (( nsupdate_fails > nsupdate_fail_limit )); then echo error: nsupdate is persistently failing >&2 exit 1 diff --git a/filesystem/usr/local/bin/git b/filesystem/usr/local/bin/git new file mode 100755 index 0000000..df67549 --- /dev/null +++ b/filesystem/usr/local/bin/git @@ -0,0 +1,34 @@ +#!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to change +# to a recommended GPL license. + +# Copyright 2024 Ian Kelling + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +case $PWD in + /p/c|/p/c/*|/q/p/c|/q/p/c/*) + orig_umask=$(umask) + umask 0077 + /usr/bin/git "$@" + umask "$orig_umask" + ;; + *) + /usr/bin/git "$@" + ;; +esac diff --git a/system-status b/system-status index ce8c44f..d525a8b 100755 --- a/system-status +++ b/system-status @@ -87,10 +87,10 @@ write-status() { if systemctl show -p SubState --value ${services[@]} | grep -E -v '^(running|)$' &>/dev/null; then for s in ${services[@]}; do if [[ $(systemctl show -p SubState --value $s 2>&1) != running ]]; then + chars+=($s) bads+=($s) fi done - chars+=(MYSERS) fi p ${bads[*]} | lo -240 mysers ;; @@ -107,10 +107,10 @@ write-status() { if systemctl show -p SubState --value ${services[@]} | grep -E -v '^(running|)$' &>/dev/null; then for s in ${services[@]}; do if [[ $(systemctl show -p SubState --value $s 2>&1) != running ]]; then + chars+=($s) bads+=($s) fi done - chars+=(PROM) fi p ${bads[*]} | lo -240 prom ;; -- 2.30.2