This commit is contained in:
pvincent
2024-10-11 00:26:55 +04:00
parent fd86ed4837
commit 609603a437
4 changed files with 17 additions and 18 deletions
+6 -8
View File
@@ -173,19 +173,17 @@ function build_routes() {
for i in "${fqdns[@]}"; do
raw_dnsmasq+="address=/$i/$DMZ_IP\\n"
# append domains to conf
echo "re-routing any connection from <$i> to internal container <$DMZ_CONTAINER.lxd>"
echo "re-routing any connection from https://$i to internal container <$DMZ_CONTAINER.lxd>"
done
builtin echo -e "$raw_dnsmasq" >"$MIAOU_CONFIGDIR/dnsmasq/raw.new"
lxc network get $BRIDGE raw.dnsmasq | head -n-1 >"$MIAOU_CONFIGDIR/dnsmasq/raw.old"
if ! diff -q "$MIAOU_CONFIGDIR/dnsmasq/raw.old" "$MIAOU_CONFIGDIR/dnsmasq/raw.new"; then
echo "reload dnsmasq"
if ! diff -q "$MIAOU_CONFIGDIR/dnsmasq/raw.old" "$MIAOU_CONFIGDIR/dnsmasq/raw.new" &>/dev/null; then
echo -n "new routes detected, reloading dnsmasq + nftables..."
builtin echo -e "$raw_dnsmasq" | lxc network set $BRIDGE raw.dnsmasq -
echo "reload nftables"
sudo systemctl reload nftables.service
else
echo "no changes"
PREFIX="" echoinfo OK
fi
}
@@ -322,7 +320,7 @@ function build_monit() {
if ! curl_check_unsecure "https://$fqdn"; then
PREFIX='' echo
echoerr "DMZ does not seem to dispatch <https://$fqdn> please review DMZ Nginx proxy"
echoerr "DMZ does not seem to dispatch https://$fqdn please review DMZ Nginx proxy"
exit 3
elif [[ "$target" != 'dev' ]] && ! curl_check "https://$fqdn"; then
PREFIX='' echo
@@ -532,7 +530,7 @@ readonly CONF="/etc/miaou/miaou.yaml"
readonly DEFAULTS="/etc/miaou/defaults.yaml"
readonly EXPANDED_CONF="$MIAOU_CONFIGDIR/miaou.expanded.yaml"
readonly BRIDGE="lxdbr0"
readonly MAX_WAIT=3 # timeout in seconds
readonly MAX_WAIT=5 # timeout in seconds
# shellcheck disable=SC2034
declare -a options=("$@")