error fixed

This commit is contained in:
2026-06-07 11:40:32 +08:00
parent 2b51fd6fab
commit 13f7fec1d3

View File

@@ -1,15 +1,20 @@
#!/bin/bash #!/bin/bash
echo "==>setup easytier config" echo "==>setup easytier config"
# 不能多行替换,需要在-i后面添加-e并且每行替换内容前都要添加-e # 不能多行替换,需要在-i后面添加-e并且每行替换内容前都要添加-e
# sed -i.bak '14curi = "tcp://39.108.52.138:11010";17cnetwork_name = "ctyuntest";18cnetwork_secret = "123456"' /opt/easytier/config/default.conf # sed -i.bak '14curi = "tcp://39.108.52.138:11010";17cnetwork_name = "ctyuntest";18cnetwork_secret = "123456"' /opt/easytier/config/default.conf
# 创建 sed 脚本 # 创建 sed 脚本
cat > replace.sed << 'EOF' cat > replace.sed << 'EOF'
14curi = "tcp://39.108.52.138:11010 uri = "tcp://39.108.52.138:11010
network_name = "ctyuntest" network_name = "ctyuntest"
network_secret = "123456" network_secret = "123456"
EOF EOF
# 执行 # 执行
sed -i.bak -f replace.sed /opt/easytier/config/default.conf sed -i.bak -f replace.sed /opt/easytier/config/default.conf
# 可选:清理临时文件 # 可选:清理临时文件
rm -f replace.sed rm -f replace.sed
echo "==>setup config done" echo "==>setup config done"