rc.ntpd: Fix 'update' subcommand

rc.nginx: Fix 'update' subcommand
rc.libvirt: Fix 'vmlist()' function to ignore 'virsh list' headers
rc.library_source: changes to support above
This commit is contained in:
Tom Mortensen
2024-10-20 10:50:00 -07:00
parent f477d2c231
commit 242d6efd26
3 changed files with 4 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ this(){
grep -Pom1 "^RPCBIND_OPTS=\"\K[^\"]+" $RPC ;;
'nginx')
MAP=();
for ADDR in $(awk '$1=="listen" && $2~/^[0-9]|\[/ && $0~/http2; #.*$/{print $2}' $SERVERS 2>/dev/null); do
for ADDR in $(awk '$1=="listen" && $2~/^[0-9]|\[/ && !/# lo/{print $2}' $SERVERS 2>/dev/null); do
# extract ipv4 / ipv6 address
[[ $(ipv $ADDR) == 4 ]] && ADDR=${ADDR%:*} || ADDR=${ADDR#*[} ADDR=${ADDR%]*}
MAP+=($ADDR)
@@ -151,7 +151,7 @@ check(){
fi
for ADDR in ${NET[@]/$NET}; do
ADDR=$(unmask $ADDR)
if [[ "avahi show" =~ "$CALLER" ]]; then
if [[ "ntp avahi show" =~ "$CALLER" ]]; then
[[ -z $(good $NET) ]] && BIND+=($NET)
else
[[ -z $(good $ADDR) ]] && BIND+=($ADDR) || continue

View File

@@ -54,7 +54,7 @@ vmlist(){
for ARG in ${@: 1}; do
[[ $ARG == all ]] && STATE="$STATE --all" || STATE="$STATE --state-$ARG"
done
virsh list --uuid $STATE | grep -v '^$'
virsh list --uuid $STATE | tail -n +3 | grep -v '^$'
}
waitfor(){

View File

@@ -35,7 +35,7 @@ ntpd_build(){
[[ $IPV6 == no ]] && echo "interface ignore ipv6" >>$CONF
# add listen interfaces
for NET in $BIND; do
echo "interface listen $(show $NET) # $NET" >>$CONF
echo "interface listen $NET" >>$CONF
done
fi
# add configured NTP servers