12 lines
308 B
Plaintext
12 lines
308 B
Plaintext
edit:add-var adguard~ {|@argv|
|
|
use str
|
|
doas chattr -i /etc/resolv.conf
|
|
var beg = 's|^.*\(192\.168\.0\.25\)|'
|
|
var end = 'nameserver \1|'
|
|
if (and (> (count $argv) 0) (str:has-prefix $argv[0] u)) {
|
|
set end = '# '$end
|
|
}
|
|
doas sed -i $beg$end /etc/resolv.conf
|
|
doas chattr +i /etc/resolv.conf
|
|
}
|