mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 02:28:03 -07:00
Web updates on ubuntu
This commit is contained in:
parent
f2dc5fad55
commit
cad5397e6a
1 changed files with 19 additions and 9 deletions
|
@ -12,8 +12,6 @@
|
|||
|
||||
# Argument defenition
|
||||
package=$1
|
||||
version=$2
|
||||
release=$3
|
||||
|
||||
# Importing system enviroment
|
||||
source /etc/profile
|
||||
|
@ -28,27 +26,39 @@ source $VESTA/func/main.sh
|
|||
#----------------------------------------------------------#
|
||||
|
||||
# Checking arg number
|
||||
check_args '1' "$#" 'PACKAGE [VERSION] [RELEASE]'
|
||||
check_args '1' "$#" 'PACKAGE'
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Clean yum chache
|
||||
yum -q clean all
|
||||
if [ -z "/etc/redhat-release" ]; then
|
||||
# Clean yum chache
|
||||
yum -q clean all
|
||||
|
||||
# Define yum cmd
|
||||
yum="yum -q -y --noplugins --disablerepo=* --enablerepo=vesta"
|
||||
# Define yum cmd
|
||||
yum="yum -q -y --noplugins --disablerepo=* --enablerepo=vesta"
|
||||
|
||||
# Update vesta package
|
||||
if [ -z "$version" ]; then
|
||||
# Update vesta package
|
||||
$yum update $package > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: $package update failed"
|
||||
log_event "$E_UPDATE" "$EVENT"
|
||||
exit $E_UPDATE
|
||||
fi
|
||||
else
|
||||
# Update repo
|
||||
apt-get update -o Dir::Etc::sourcelist="sources.list.d/vesta.list" \
|
||||
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -qq
|
||||
|
||||
# Update vesta package
|
||||
apt-get install $package -qq > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: $package update failed"
|
||||
log_event "$E_UPDATE" "$EVENT"
|
||||
exit $E_UPDATE
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue