#!/bin/sh
current_system_version=`grep "VERSION" /etc/os-release | cut -f 2 -d '='`
agent_status=0
if [ x"$current_system_version" \< x"3.5.7_1.1.8" ]; then
agent_status=1
fi
if [ x"$agent_status" == x"1" ]; then
echo "ok"
fi
系统版本检查脚本
本文介绍了一个用于检查当前系统版本是否低于特定版本的Shell脚本。脚本通过读取/etc/os-release文件中的VERSION信息,与预设版本进行比较,若当前版本低于预设版本,则返回ok信号。
#!/bin/sh
current_system_version=`grep "VERSION" /etc/os-release | cut -f 2 -d '='`
agent_status=0
if [ x"$current_system_version" \< x"3.5.7_1.1.8" ]; then
agent_status=1
fi
if [ x"$agent_status" == x"1" ]; then
echo "ok"
fi
591
828

被折叠的 条评论
为什么被折叠?