diff --git a/token-validator/wg.go b/token-validator/wg.go index 91368fa..d17bebe 100644 --- a/token-validator/wg.go +++ b/token-validator/wg.go @@ -110,6 +110,8 @@ func getWgTunnelInfo(w http.ResponseWriter, r *http.Request, ps httprouter.Param return } + syncWgConf() + tinfo := getTunnelInfo(token.IdStudent) w.Header().Set("Content-Type", "text/plain") @@ -264,6 +266,13 @@ AllowedIPs = %s/%d return nil } + +func syncWgConf() (err error) { + _, err = exec.Command("sh", "/root/wg-sync.sh").Output() + return +} + + type WGDump struct { PubKey string PSK string