Files
tms-arch-linux-calamares-in…/archiso/airootfs/home/smart/SmartOrganizer/lib.conf
2025-11-25 00:09:24 +08:00

25 lines
567 B
Plaintext
Executable File

version_compare()
{
source=(${1//./ })
target=(${2//./ })
for ((i=0; i<${#source[@]}; i++)); do
if [[ ${source[i]} == ${target[i]} ]]; then
continue
fi
if [[ ${source[i]} -lt ${target[i]} ]]; then
echo -1
return
elif [[ ${source[i]} -gt ${target[i]} ]]; then
echo 1
return
fi
done
echo 0
}
getSystemVersion()
{
releasetmp=`cat /etc/redhat-release | awk -Frelease '{print $2}' | awk -F. '{print $1}' | awk '{print $1}'`
echo $releasetmp
}