Skip to content

Commit a4ee392

Browse files
committed
added --noupdate option to skip yum update
1 parent 76e8a7e commit a4ee392

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

install/vst-install.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ help() {
3030
-d, --disable-remi Disable remi
3131
-e, --email Define email address
3232
-h, --help Print this help and exit
33-
-f, --force Force installation"
33+
-f, --force Force installation
34+
-n, --noupdate Do not run yum update command"
3435
exit 1
3536
}
3637

@@ -58,19 +59,21 @@ for arg; do
5859
--disable-remi) args="${args}-d " ;;
5960
--force) args="${args}-f " ;;
6061
--email) args="${args}-e " ;;
62+
--noupdate) args="${args}-n " ;;
6163
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
6264
args="${args}${delim}${arg}${delim} ";;
6365
esac
6466
done
6567
eval set -- "$args"
6668

6769
# Getopt
68-
while getopts "dhfe:" Option; do
70+
while getopts "dhfne:" Option; do
6971
case $Option in
7072
d) disable_remi='yes' ;; # Disable remi repo
7173
h) help ;; # Help
7274
e) email=$OPTARG ;; # Set email
73-
f) force=yes ;; # Force install
75+
f) force='yes' ;; # Force install
76+
n) noupdate='yes' ;; # Disable yum update
7477
*) help ;; # Default
7578
esac
7679
done
@@ -216,10 +219,12 @@ echo -e "\n\n\n\nInstallation will take about 15 minutes ...\n"
216219
sleep 5
217220

218221
# Update system
219-
yum -y update
220-
if [ $? -ne 0 ]; then
221-
echo 'Error: yum update failed'
222-
exit 1
222+
if [ -z "$noupdate" ]; then
223+
yum -y update
224+
if [ $? -ne 0 ]; then
225+
echo 'Error: yum update failed'
226+
exit 1
227+
fi
223228
fi
224229

225230
# Install EPEL repo
@@ -726,6 +731,7 @@ wget $CHOST/$VERSION/certificate.key -O certificate.key
726731
if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then
727732
chattr -i /home/admin/conf > /dev/null 2>&1
728733
userdel -f admin
734+
chattr -i /home/admin/conf
729735
mv -f /home/admin $vst_backups/home/
730736
rm -f /tmp/sess_*
731737
fi

0 commit comments

Comments
 (0)