Skip to content

Commit a2eb0f2

Browse files
author
Ronald van Zantvoort
committed
vRouter: vr_cfg: style consistency fixes
1 parent 8f52753 commit a2eb0f2

1 file changed

Lines changed: 15 additions & 30 deletions

File tree

  • systemvm/patches/debian/config/opt/cloud/bin

systemvm/patches/debian/config/opt/cloud/bin/vr_cfg.sh

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,28 @@ log_it() {
2727
echo "$(date) : $*" >> $log
2828
}
2929

30-
while getopts 'c:' OPTION
31-
do
32-
case $OPTION in
33-
c) cfg="$OPTARG"
34-
;;
35-
esac
36-
done
30+
while getopts 'c:' OPTION; do
31+
case $OPTION in
32+
c) cfg="$OPTARG" ;;
33+
esac; done
3734

38-
while read line
39-
do
35+
while read line; do
4036
#comment
41-
if [[ $line == \#* ]]
42-
then
43-
continue
44-
fi
37+
if [[ $line == \#* ]]; then
38+
continue
4539

46-
if [ "$line" == "<version>" ]
47-
then
40+
elif [ "$line" == "<version>" ]; then
4841
read line
4942
version=$line
5043
log_it "VR config: configuation format version $version"
5144
#skip </version>
5245
read line
53-
continue
54-
fi
5546

56-
if [ "$line" == "<script>" ]
57-
then
47+
elif [ "$line" == "<script>" ]; then
5848
read line
5949
log_it "VR config: executing: $line"
6050
eval $line >> $log 2>&1
61-
if [ $? -ne 0 ]
62-
then
51+
if [ $? -ne 0 ]; then
6352
log_it "VR config: executing failed: $line"
6453
# expose error info to mgmt server
6554
echo "VR config: execution failed: \"$line\", check $log in VR for details " 1>&2
@@ -68,26 +57,22 @@ do
6857
#skip </script>
6958
read line
7059
log_it "VR config: execution success "
71-
continue
72-
fi
7360

74-
if [ "$line" == "<file>" ]
75-
then
61+
elif [ "$line" == "<file>" ]; then
7662
read line
7763
file=$line
7864
log_it "VR config: creating file: $file"
7965
rm -f $file
80-
while read -r line
81-
do
82-
if [ "$line" == "</file>" ]
83-
then
66+
while read -r line; do
67+
if [ "$line" == "</file>" ]; then
8468
break
8569
fi
8670
echo $line >> $file
8771
done
8872
log_it "VR config: create file success"
89-
continue
73+
9074
fi
75+
9176
done < $cfg
9277

9378
# archive the configuration file

0 commit comments

Comments
 (0)