Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions internal/router/dnsmasq/dnsmasq.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package dnsmasq

import (
"errors"
"text/template"
"net"
"os"
"path/filepath"
"strings"
"text/template"

"github.com/Control-D-Inc/ctrld"
)
Expand All @@ -28,17 +28,21 @@ max-cache-ttl=0
`

const (
MerlinConfPath = "/tmp/etc/dnsmasq.conf"
MerlinJffsConfDir = "/jffs/configs"
MerlinJffsConfPath = "/jffs/configs/dnsmasq.conf"
MerlinPostConfPath = "/jffs/scripts/dnsmasq.postconf"
MerlinConfPath = "/tmp/etc/dnsmasq.conf"
MerlinJffsConfDir = "/jffs/configs"
MerlinJffsConfPath = "/jffs/configs/dnsmasq.conf"
MerlinPostConfPath = "/jffs/scripts/dnsmasq.postconf"
)

const MerlinPostConfMarker = `# GENERATED BY ctrld - EOF`
const MerlinPostConfTmpl = `# GENERATED BY ctrld - DO NOT MODIFY

#!/bin/sh
const (
MerlinPostConfBeginMarker = `# BEGIN ctrld`
MerlinPostConfEndMarker = `# END ctrld`
MerlinSyntheticShebangMarker = `# ctrld: synthetic shebang`
// MerlinPostConfMarker is the legacy end marker used by ctrld <= 1.5.7.
MerlinPostConfMarker = `# GENERATED BY ctrld - EOF`
)

const MerlinPostConfTmpl = `(
config_file="$1"
. /usr/sbin/helper.sh

Expand Down Expand Up @@ -66,9 +70,8 @@ if [ -n "$pid" ] && [ -f "/proc/${pid}/cmdline" ]; then
# Change /etc/resolv.conf, which may be changed by WAN DNS setup
pc_delete "nameserver" /etc/resolv.conf
pc_append "nameserver 127.0.0.1" /etc/resolv.conf

exit 0
fi
)
`

type Upstream struct {
Expand Down
Loading
Loading