@@ -33,15 +33,6 @@ check_installed_deb() {
3333 TIME=$( date -d @$pkg_date +" %T" )
3434}
3535
36- # Check details of installed .rpm package function
37- check_installed_rpm () {
38- rpm_data=$( rpm -qi $1 )
39- ARCH=$( echo " $rpm_data " | grep Architecture | cut -f 2 -d ' ' )
40- VERSION=$( echo " $rpm_data " | grep Version | cut -f 2 -d ' :' | xargs)
41- DATE=$( echo " $rpm_data " | grep " Build Date" | awk ' {print $5 " " $6 " " $7}' )
42- TIME=$( echo " $rpm_data " | grep " Build Date" | awk ' {print $8 " " $9 " " $10}' )
43- }
44-
4536# JSON list function
4637json_list () {
4738 IFS=$' \n '
@@ -84,22 +75,12 @@ shell_list() {
8475# ----------------------------------------------------------#
8576
8677# Checking official latest version
87- if [ -f ' /etc/redhat-release' ]; then
88- hestia_v=$( dnf list hestia | grep hestia | awk ' {print $2}' | cut -f 1 -d ' -' )
89- nginx_v=$( dnf list hestia-nginx | grep hestia-nginx | awk ' {print $2}' | cut -f 1 -d ' -' )
90- php_v=$( dnf list hestia-php | grep hestia-php | awk ' {print $2}' | cut -f 1 -d ' -' )
91- else
92- hestia_v=$( apt-cache policy hestia | grep Candidate | cut -d ' :' -f 2 | xargs)
93- nginx_v=$( apt-cache policy hestia-nginx | grep Candidate | cut -d ' :' -f 2 | xargs)
94- php_v=$( apt-cache policy hestia-php | grep Candidate | cut -d ' :' -f 2 | xargs)
95- fi
78+ hestia_v=$( apt-cache policy hestia | grep Candidate | cut -d ' :' -f 2 | xargs)
79+ nginx_v=$( apt-cache policy hestia-nginx | grep Candidate | cut -d ' :' -f 2 | xargs)
80+ php_v=$( apt-cache policy hestia-php | grep Candidate | cut -d ' :' -f 2 | xargs)
9681
9782# Checking installed hestia version
98- if [ -f ' /etc/redhat-release' ]; then
99- check_installed_rpm hestia
100- else
101- check_installed_deb hestia
102- fi
83+ check_installed_deb hestia
10384
10485UPDATED=' yes'
10586if [ -n " $hestia_v " ] && [ " $hestia_v " \> " $VERSION " ]; then
@@ -110,11 +91,7 @@ data="NAME='hestia' VERSION='$VERSION' ARCH='$ARCH'"
11091data=" $data UPDATED='$UPDATED ' DESCR='Hestia core package' TIME='$TIME ' DATE='$DATE '"
11192
11293# Checking installed hestia-php version
113- if [ -f ' /etc/redhat-release' ]; then
114- check_installed_rpm hestia-php
115- else
116- check_installed_deb hestia-php
117- fi
94+ check_installed_deb hestia-php
11895
11996UPDATED=' yes'
12097if [ -n " $php_v " ] && [ " $php_v " \> " $VERSION " ]; then
@@ -126,11 +103,7 @@ data="$data ARCH='$ARCH' UPDATED='$UPDATED' DESCR='Hestia internal php interpret
126103data=" $data TIME='$TIME ' DATE='$DATE '"
127104
128105# Checking installed hestia-nginx version
129- if [ -f ' /etc/redhat-release' ]; then
130- check_installed_rpm hestia-nginx
131- else
132- check_installed_deb hestia-nginx
133- fi
106+ check_installed_deb hestia-nginx
134107
135108UPDATED=' yes'
136109if [ -n " $nginx_v " ] && [ " $nginx_v " \> " $VERSION " ]; then
0 commit comments