mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-19 21:04:06 -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
|
# Argument defenition
|
||||||
package=$1
|
package=$1
|
||||||
version=$2
|
|
||||||
release=$3
|
|
||||||
|
|
||||||
# Importing system enviroment
|
# Importing system enviroment
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
|
@ -28,27 +26,39 @@ source $VESTA/func/main.sh
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Checking arg number
|
# Checking arg number
|
||||||
check_args '1' "$#" 'PACKAGE [VERSION] [RELEASE]'
|
check_args '1' "$#" 'PACKAGE'
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Action #
|
# Action #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Clean yum chache
|
if [ -z "/etc/redhat-release" ]; then
|
||||||
yum -q clean all
|
# Clean yum chache
|
||||||
|
yum -q clean all
|
||||||
|
|
||||||
# Define yum cmd
|
# Define yum cmd
|
||||||
yum="yum -q -y --noplugins --disablerepo=* --enablerepo=vesta"
|
yum="yum -q -y --noplugins --disablerepo=* --enablerepo=vesta"
|
||||||
|
|
||||||
# Update vesta package
|
# Update vesta package
|
||||||
if [ -z "$version" ]; then
|
|
||||||
$yum update $package > /dev/null 2>&1
|
$yum update $package > /dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error: $package update failed"
|
echo "Error: $package update failed"
|
||||||
log_event "$E_UPDATE" "$EVENT"
|
log_event "$E_UPDATE" "$EVENT"
|
||||||
exit $E_UPDATE
|
exit $E_UPDATE
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue