#!/bin/bash

headscale -n wdd-net nodes register --key 8dd741ebd47fe1b4b24277f419c60f103187268df8d1efb8e6511fc157d93d2b
read_dir(){
    for file in `ls -a $1`
    do
        if [ -d $1"/"$file ]
        then
            if [[ $file != '.' && $file != '..' ]]
            then
                read_dir $1"/"$file
            fi
        else
            echo $1"/"$file
            echo "开始修改当前文件：$1/$file"
            sed -i "s/192.168.200.131/10.10.10.146/g" $1"/"$file
            echo ""
        fi
    done
}
#测试目录 test
read_dir /home/dxf


k3s_cluster=(t1 t2 t0 tc-hk)
for node in ${k3s_cluster[*]}
do

  echo "current node is $node"

  ssh -p 22333 $node "systemctl restart k3s-agent"

done



 kubectl -n kube-system delete pod $(kubectl -n kube-system get pods | grep svclb | awk '{print$1}')

