clean-ups in the file

- replace tabs with 4 spaces
- removed trailing spaces
- fixed indenting
- made if; then look the same
This commit is contained in:
Remi Bergsma 2015-08-11 14:55:16 +02:00
parent ee9b644e28
commit 2f858a7d08

View File

@ -45,40 +45,41 @@ jasypt='/usr/share/cloudstack-common/lib/jasypt-1.9.2.jar'
while getopts 'm:h:f:u:Ft:e:s:o:r:d:p:'# OPTION while getopts 'm:h:f:u:Ft:e:s:o:r:d:p:'# OPTION
do do
case $OPTION in case $OPTION in
m) mflag=1 m) mflag=1
mntpoint="$OPTARG" mntpoint="$OPTARG"
;; ;;
f) fflag=1 f) fflag=1
tmpltimg="$OPTARG" tmpltimg="$OPTARG"
;; ;;
u) uflag=1 u) uflag=1
url="$OPTARG" url="$OPTARG"
;; ;;
F) Fflag=1 ;; F) Fflag=1
;;
t) templateId="$OPTARG" t) templateId="$OPTARG"
;; ;;
e) ext="$OPTARG" e) ext="$OPTARG"
;; ;;
h) hyper="$OPTARG" h) hyper="$OPTARG"
;; ;;
s) sflag=1 s) sflag=1
msKey="$OPTARG" msKey="$OPTARG"
;; ;;
o) oflag=1 o) oflag=1
dbHost="$OPTARG" dbHost="$OPTARG"
;; ;;
r) rflag=1 r) rflag=1
dbUser="$OPTARG" dbUser="$OPTARG"
;; ;;
d) dflag=1 d) dflag=1
dbPassword="$OPTARG" dbPassword="$OPTARG"
;; ;;
p) pflag=1 p) pflag=1
dbPort="$OPTARG" dbPort="$OPTARG"
;; ;;
?) usage ?) usage
failed 2 failed 2
;; ;;
esac esac
done done
@ -106,16 +107,20 @@ then
failed 3 failed 3
fi fi
if [ -f /etc/cloudstack/management/db.properties ]; then if [ -f /etc/cloudstack/management/db.properties ]
if [ "$pflag" != 1 ]; then then
if [ "$pflag" != 1 ]
then
dbPort=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 'db.cloud.port' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') dbPort=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 'db.cloud.port' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
fi fi
if [ "$oflag" != 1 ]; then if [ "$oflag" != 1 ]
then
dbHost=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 'db.cloud.host' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') dbHost=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 'db.cloud.host' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
fi fi
if [ "$rflag" != 1 ]; then if [ "$rflag" != 1 ]
then
dbUser=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 'db.cloud.username' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') dbUser=$(sed '/^\#/d' /etc/cloudstack/management/db.properties | grep 'db.cloud.username' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
fi fi
@ -186,8 +191,8 @@ fi
if [ ! $templateId ] if [ ! $templateId ]
then then
echo "Unable to get template Id from database" echo "Unable to get template Id from database"
failed 8 failed 8
fi fi
_uuid=$(uuidgen) _uuid=$(uuidgen)