local active=true
systemctl is-active btrbk.timer || active=false
if $active; then
- ser disable btrbk.timer
+ ser stop btrbk.timer
fi
- if systemctl is-active btrbk.service; then
- $active && ser enable btrbk.timer
+ if [[ $(systemctl is-active btrbk.service ||:) != inactive ]]; then
echo "cron btrbk is already running"
+ if $active; then ser start btrbk.timer; fi
return 1
fi
# run latest
jrun -p btrbk btrbk-run "$@"
if $active; then
if (( $ret )); then
- echo bbk: WARNING: btrbk.timer not reenabled due to failure
+ echo bbk: WARNING: btrbk.timer not restarted due to failure
else
- ser enable btrbk.timer
+ ser start btrbk.timer
fi
fi
return $ret
m s nscd -i hosts
f=/etc/resolv.conf
echo $f:; ccat $f
- # this will fail is dnsmasq is failed
- hr; m ser status dnsmasq | cat || :
hr; s ss -lpn 'sport = 53'
- #hr; echo dnsmasq is $(systemctl is-active dnsmasq)
- f=/var/run/dnsmasq/resolv.conf
- hr; echo $f:; ccat $f
- hr; m grr '^ *(servers-file|server) *=|^ *no-resolv *$' /etc/dnsmasq.conf /etc/dnsmasq.d
- f=/etc/dnsmasq-servers.conf
- hr; echo $f:; ccat $f
+ if systemctl is-enabled dnsmasq &>/dev/null || [[ $(systemctl is-active dnsmasq ||:) != inactive ]]; then
+ # this will fail is dnsmasq is failed
+ hr; m ser status dnsmasq | cat || :
+ f=/var/run/dnsmasq/resolv.conf
+ hr; echo $f:; ccat $f
+ hr; m grr '^ *(servers-file|server) *=|^ *no-resolv *$' /etc/dnsmasq.conf /etc/dnsmasq.d
+ f=/etc/dnsmasq-servers.conf
+ hr; echo $f:; ccat $f
+ fi
+ if systemctl is-enabled systemd-resolved &>/dev/null || [[ $(systemctl is-active systemd-resolved ||:) != inactive ]]; then
+ hr; m ser status systemd-resolved | cat || :
+ hr; m systemd-resolve --status
+ fi
+
}
rcat() {
resolvcat | less
}
reresolv() {
sudo nscd -i hosts
- sudo systemctl restart dnsmasq
+ #sudo systemctl restart dnsmasq
}
# only run on MAIL_HOST. simpler to keep this on one system.