我的Linux上有VestaCP,我想知道当前VestaCP的版本是什么。我该怎么做?
发布于 2018-06-30 00:21:26
在任何地方创建一个新的bash文件,例如/root/,名称为check_vesta_version.sh,并向其中添加以下代码。
#!/bin/bash
#vestapc version checker
#beta script
# Checking installed vesta version
if [ -d "/etc/sysconfig" ]; then
rpm_format="VERSION='%{VERSION}'"
rpm_format="$rpm_format RELEASE='%{RELEASE}'"
rpm_format="$rpm_format ARCH='%{ARCH}'"
rpm_format="$rpm_format UTIME='%{INSTALLTIME}'\n"
eval $(rpm --queryformat="$rpm_format" -q vesta)
DATE=$(date -d @$UTIME +%F)
TIME=$(date -d @$UTIME +%T)
else
dpkg_data=$(dpkg-query -s vesta)
pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/vesta.list)
ARCH=$(echo "$dpkg_data"|grep Architecture |cut -f 2 -d ' ')
VERSION=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' '|cut -f 1 -d \-)
RELEASE=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' '|cut -f 2 -d \-)
DATE=$(date -d @$pkg_date +"%F")
TIME=$(date -d @$pkg_date +"%T")
fi
echo $VERSION-$RELEASE然后使用以下方法运行文件
bash check_vesta_version.sh您将获得当前运行的vesta版本,例如: 0.9.8-22
如果您想要通过chek网站来了解最新可供下载的维塔奇版本,请在shell命令中运行下面的命令
wget -q -T 1 -t 1 http://c.vestacp.com/latest.txt -O -此外,您还可以通过运行以下命令来了解是否有您的vestacp版本的更新
v-list-sys-vesta-updates或
/usr/local/vesta/bin/v-list-sys-vesta-updateshttps://serverfault.com/questions/918919
复制相似问题