digdiff @ns{1,2}.iankelling.org "$@"
}
+tsr() { # ts run
+ "$@" |& ts || return $?
+}
dup() {
local ran_d
case $PS1 in
*[\ \]]D\ *)
pushd /
- /b/ds/distro-begin || return $?
- /b/ds/distro-end || return $?
+ /b/ds/distro-begin |& ts || return $?
+ /b/ds/distro-end |& ts || return $?
popd
ran_d=true
;;&
*[\ \]]DB\ *)
pushd /
- /b/ds/distro-begin || return $?
+ /b/ds/distro-begin |& ts || return $?
popd
ran_d=true
;;
*[\ \]]DE\ *)
pushd /
- /b/ds/distro-end || return $?
+ /b/ds/distro-end |& ts || return $?
popd
ran_d=true
;;&
if [[ ! -e /etc/systemd/system/wg-quick@wghole.service.d/override.conf ]]; then
reload=true
fi
+ sudo mkdir -p /etc/systemd/system/wg-quick@wghole.service.d
sd /etc/systemd/system/wg-quick@wghole.service.d/override.conf <<'EOF'
[Unit]
StartLimitIntervalSec=0
[Service]
-Restart=always
+Restart=on-failure
RestartSec=20
EOF
if $reload; then ser daemon-reload; fi
--- /dev/null
+[Service]
+# uncomment to debug
+#Environment=SYSTEMD_LOG_LEVEL=debug
+
+ExecStartPost=/a/bin/ds/fixvpndns
+++ /dev/null
-# uncomment for debugging
-#[Service]
-#Environment=SYSTEMD_LOG_LEVEL=debug
--- /dev/null
+#!/bin/bash
+# Copyright (C) 2019 Ian Kelling
+# SPDX-License-Identifier: AGPL-3.0-or-later
+source /a/bin/errhandle/err
+
+resolvuid=$(id -u systemd-resolve)
+case $EUID in
+ 0|$resolvuid) : ;;
+ *) exec sudo -E "${BASH_SOURCE[0]}" "$@" ;;
+esac
+
+
+if ! resolvectl dnsovertls tunfsf &>/dev/null; then
+ echo failed resolvectl dnsovertls tunfsf. rerunning:
+ resolvectl dnsovertls tunfsf
+ exit 0
+fi
+read _ link _ < <(resolvectl dnsovertls tunfsf)
+busctl call org.freedesktop.resolve1 /org/freedesktop/resolve1 org.freedesktop.resolve1.Manager SetLinkDNSOverTLS is $link no
After=network.target mailnn.service
JoinsNamespaceOf=mailnn.service
BindsTo=mailnn.service
+StartLimitIntervalSec=0
[Service]
PrivateNetwork=true
# i dont think we need any of these, but it doesnt hurt to stay consistent
BindPaths=$bindpaths
+
+Restart=on-failure
+RestartSec=20
EOF
;;
esac