added the base which is ai code and this will be tailored (and have been a little) for specifice yejayekhoob.com use case and tested extensively under short period of time

This commit is contained in:
db1234719
2026-02-15 01:44:38 +03:30
commit 1967b1a92e
5 changed files with 195 additions and 0 deletions

27
bind.go Normal file
View File

@@ -0,0 +1,27 @@
package main
import (
"fmt"
"os"
"os/exec"
)
func SwitchBindConfig(source, target string) error {
input, err := os.ReadFile(source)
if err != nil {
return fmt.Errorf("read source config: %w", err)
}
err = os.WriteFile(target, input, 0o644)
if err != nil {
return fmt.Errorf("write active config: %w", err)
}
cmd := exec.Command("rndc", "reload")
err = cmd.Run()
if err != nil {
return fmt.Errorf("reload bind: %w", err)
}
return nil
}