更新 'cg_init_machine.sh'
This commit is contained in:
parent
aaf1453064
commit
9775c7c4ca
|
|
@ -27,7 +27,7 @@ echo "$res" >/home/cg_maintain_user/.ssh/authorized_keys
|
||||||
chown -R cg_maintain_user:cg_maintain_user /home/cg_maintain_user
|
chown -R cg_maintain_user:cg_maintain_user /home/cg_maintain_user
|
||||||
chmod 600 /home/cg_maintain_user/.ssh/authorized_keys
|
chmod 600 /home/cg_maintain_user/.ssh/authorized_keys
|
||||||
|
|
||||||
if command -v yum >/dev/null >/dev/null 2>&1
|
if command -v yum >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
sudo yum install -y net-snmp
|
sudo yum install -y net-snmp
|
||||||
else
|
else
|
||||||
|
|
@ -38,7 +38,7 @@ sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.bak
|
||||||
sudo curl -L -o /etc/snmp/snmpd.conf https://git.tobyliu.com/toby/common-tools/raw/branch/main/snmpd.conf
|
sudo curl -L -o /etc/snmp/snmpd.conf https://git.tobyliu.com/toby/common-tools/raw/branch/main/snmpd.conf
|
||||||
sudo systemctl restart snmpd
|
sudo systemctl restart snmpd
|
||||||
|
|
||||||
if command -v firewall-cmd >/dev/null >/dev/null 2>&1
|
if command -v firewall-cmd >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
sudo firewall-cmd --zone=public --add-service=snmp --permanent
|
sudo firewall-cmd --zone=public --add-service=snmp --permanent
|
||||||
sudo firewall-cmd --reload
|
sudo firewall-cmd --reload
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue