最近鼓捣双机热备,写了些shell脚本

适用配置文件

以 ifbeat 为例,linux的标准的配置文件中等号两遍不能存在括号, 空格 或特殊符号可以用转衣服 ' '

beat=true
primary=true
vip=12.22.192.146
 

shell中读取配置文件

source 命令会读取配置文件,然后将配置文件中等号左面的key列作为变量读入内存中

source cofingfile

echo $beat      // true
echo $primary   // true
echo $vip       // 12.22.192.146

相关文章:

  • 2021-09-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2021-07-11
  • 2021-09-09
  • 2022-01-08
猜你喜欢
  • 2021-07-25
  • 2021-12-10
  • 2022-12-23
  • 2021-09-20
  • 2022-01-20
  • 2022-02-07
  • 2021-11-30
相关资源
相似解决方案