Skip to content

Commit 2f858a7

Browse files
committed
clean-ups in the file
- replace tabs with 4 spaces - removed trailing spaces - fixed indenting - made if; then look the same
1 parent ee9b644 commit 2f858a7

File tree

1 file changed

+37
-32
lines changed

1 file changed

+37
-32
lines changed

scripts/storage/secondary/cloud-install-sys-tmplt

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
# to you under the Apache License, Version 2.0 (the
99
# "License"); you may not use this file except in compliance
1010
# with the License. You may obtain a copy of the License at
11-
#
11+
#
1212
# http://www.apache.org/licenses/LICENSE-2.0
13-
#
13+
#
1414
# Unless required by applicable law or agreed to in writing,
1515
# software distributed under the License is distributed on an
1616
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -45,40 +45,41 @@ jasypt='/usr/share/cloudstack-common/lib/jasypt-1.9.2.jar'
4545
while getopts 'm:h:f:u:Ft:e:s:o:r:d:p:'# OPTION
4646
do
4747
case $OPTION in
48-
m) mflag=1
49-
mntpoint="$OPTARG"
50-
;;
51-
f) fflag=1
52-
tmpltimg="$OPTARG"
53-
;;
54-
u) uflag=1
55-
url="$OPTARG"
56-
;;
57-
F) Fflag=1 ;;
48+
m) mflag=1
49+
mntpoint="$OPTARG"
50+
;;
51+
f) fflag=1
52+
tmpltimg="$OPTARG"
53+
;;
54+
u) uflag=1
55+
url="$OPTARG"
56+
;;
57+
F) Fflag=1
58+
;;
5859
t) templateId="$OPTARG"
59-
;;
60+
;;
6061
e) ext="$OPTARG"
61-
;;
62+
;;
6263
h) hyper="$OPTARG"
63-
;;
64+
;;
6465
s) sflag=1
65-
msKey="$OPTARG"
66-
;;
66+
msKey="$OPTARG"
67+
;;
6768
o) oflag=1
6869
dbHost="$OPTARG"
69-
;;
70+
;;
7071
r) rflag=1
7172
dbUser="$OPTARG"
72-
;;
73+
;;
7374
d) dflag=1
7475
dbPassword="$OPTARG"
75-
;;
76+
;;
7677
p) pflag=1
7778
dbPort="$OPTARG"
78-
;;
79-
?) usage
80-
failed 2
81-
;;
79+
;;
80+
?) usage
81+
failed 2
82+
;;
8283
esac
8384
done
8485

@@ -94,28 +95,32 @@ then
9495
failed 2
9596
fi
9697

97-
if [ ! -d $mntpoint ]
98+
if [ ! -d $mntpoint ]
9899
then
99100
echo "mount point $mntpoint doesn't exist\n"
100101
failed 4
101102
fi
102103

103-
if [[ "$fflag" == "1" && ! -f $tmpltimg ]]
104+
if [[ "$fflag" == "1" && ! -f $tmpltimg ]]
104105
then
105106
echo "template image file $tmpltimg doesn't exist"
106107
failed 3
107108
fi
108109

109-
if [ -f /etc/cloudstack/management/db.properties ]; then
110-
if [ "$pflag" != 1 ]; then
110+
if [ -f /etc/cloudstack/management/db.properties ]
111+
then
112+
if [ "$pflag" != 1 ]
113+
then
111114
dbPort=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 'db.cloud.port' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
112115
fi
113116

114-
if [ "$oflag" != 1 ]; then
117+
if [ "$oflag" != 1 ]
118+
then
115119
dbHost=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 'db.cloud.host' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
116120
fi
117121

118-
if [ "$rflag" != 1 ]; then
122+
if [ "$rflag" != 1 ]
123+
then
119124
dbUser=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 'db.cloud.username' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
120125
fi
121126

@@ -186,8 +191,8 @@ fi
186191

187192
if [ ! $templateId ]
188193
then
189-
echo "Unable to get template Id from database"
190-
failed 8
194+
echo "Unable to get template Id from database"
195+
failed 8
191196
fi
192197

193198
_uuid=$(uuidgen)

0 commit comments

Comments
 (0)