diff --git a/scripts/set_ip.sh b/scripts/set_ip.sh index 2aae4f0..260698e 100644 --- a/scripts/set_ip.sh +++ b/scripts/set_ip.sh @@ -50,6 +50,10 @@ echo -e "修改主机名称" hostnamectl set-hostname "${INBAND_IP//./-}" bash -# 9. 最终提示 +# 9.清理记录 +crontab -l | grep -v '@reboot bash /opt/set_ip.sh > /tmp/ip_tmp.log' | crontab - +>/opt/ip.txt + +# 10. 最终提示 echo -e "[完成] 网络配置已更新,可通过 'ip addr show eth0' 查看实际生效情况" exit 0 \ No newline at end of file