mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
added --noupdate option to skip yum update
This commit is contained in:
parent
76e8a7e890
commit
a4ee392ef2
1 changed files with 13 additions and 7 deletions
|
@ -30,7 +30,8 @@ help() {
|
||||||
-d, --disable-remi Disable remi
|
-d, --disable-remi Disable remi
|
||||||
-e, --email Define email address
|
-e, --email Define email address
|
||||||
-h, --help Print this help and exit
|
-h, --help Print this help and exit
|
||||||
-f, --force Force installation"
|
-f, --force Force installation
|
||||||
|
-n, --noupdate Do not run yum update command"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +59,7 @@ for arg; do
|
||||||
--disable-remi) args="${args}-d " ;;
|
--disable-remi) args="${args}-d " ;;
|
||||||
--force) args="${args}-f " ;;
|
--force) args="${args}-f " ;;
|
||||||
--email) args="${args}-e " ;;
|
--email) args="${args}-e " ;;
|
||||||
|
--noupdate) args="${args}-n " ;;
|
||||||
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
|
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
|
||||||
args="${args}${delim}${arg}${delim} ";;
|
args="${args}${delim}${arg}${delim} ";;
|
||||||
esac
|
esac
|
||||||
|
@ -65,12 +67,13 @@ done
|
||||||
eval set -- "$args"
|
eval set -- "$args"
|
||||||
|
|
||||||
# Getopt
|
# Getopt
|
||||||
while getopts "dhfe:" Option; do
|
while getopts "dhfne:" Option; do
|
||||||
case $Option in
|
case $Option in
|
||||||
d) disable_remi='yes' ;; # Disable remi repo
|
d) disable_remi='yes' ;; # Disable remi repo
|
||||||
h) help ;; # Help
|
h) help ;; # Help
|
||||||
e) email=$OPTARG ;; # Set email
|
e) email=$OPTARG ;; # Set email
|
||||||
f) force=yes ;; # Force install
|
f) force='yes' ;; # Force install
|
||||||
|
n) noupdate='yes' ;; # Disable yum update
|
||||||
*) help ;; # Default
|
*) help ;; # Default
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
@ -216,11 +219,13 @@ echo -e "\n\n\n\nInstallation will take about 15 minutes ...\n"
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
# Update system
|
# Update system
|
||||||
|
if [ -z "$noupdate" ]; then
|
||||||
yum -y update
|
yum -y update
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo 'Error: yum update failed'
|
echo 'Error: yum update failed'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Install EPEL repo
|
# Install EPEL repo
|
||||||
if [ ! -e '/etc/yum.repos.d/epel.repo' ]; then
|
if [ ! -e '/etc/yum.repos.d/epel.repo' ]; then
|
||||||
|
@ -726,6 +731,7 @@ wget $CHOST/$VERSION/certificate.key -O certificate.key
|
||||||
if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then
|
if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then
|
||||||
chattr -i /home/admin/conf > /dev/null 2>&1
|
chattr -i /home/admin/conf > /dev/null 2>&1
|
||||||
userdel -f admin
|
userdel -f admin
|
||||||
|
chattr -i /home/admin/conf
|
||||||
mv -f /home/admin $vst_backups/home/
|
mv -f /home/admin $vst_backups/home/
|
||||||
rm -f /tmp/sess_*
|
rm -f /tmp/sess_*
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue