2021-12-11 21:09:02 +00:00
|
|
|
edit:add-var adguard~ {|@argv|
|
2021-08-24 18:45:25 +00:00
|
|
|
use str
|
2022-08-09 11:32:42 +00:00
|
|
|
doas chattr -i /etc/resolv.conf
|
2021-08-27 19:45:39 +00:00
|
|
|
var beg = 's|^.*\(192\.168\.0\.25\)|'
|
|
|
|
var end = 'nameserver \1|'
|
2021-08-24 18:45:25 +00:00
|
|
|
if (and (> (count $argv) 0) (str:has-prefix $argv[0] u)) {
|
2021-10-13 18:43:40 +00:00
|
|
|
set end = '# '$end
|
2021-08-24 18:45:25 +00:00
|
|
|
}
|
2022-08-09 11:32:42 +00:00
|
|
|
doas sed -i $beg$end /etc/resolv.conf
|
|
|
|
doas chattr +i /etc/resolv.conf
|
2021-08-24 18:45:25 +00:00
|
|
|
}
|