diff --git a/systemvm/patches/debian/config/opt/cloud/bin/vr_cfg.sh b/systemvm/patches/debian/config/opt/cloud/bin/vr_cfg.sh index e004127c2a0..ab16b40d6d3 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/vr_cfg.sh +++ b/systemvm/patches/debian/config/opt/cloud/bin/vr_cfg.sh @@ -27,39 +27,28 @@ log_it() { echo "$(date) : $*" >> $log } -while getopts 'c:' OPTION -do - case $OPTION in - c) cfg="$OPTARG" - ;; - esac -done +while getopts 'c:' OPTION; do + case $OPTION in + c) cfg="$OPTARG" ;; +esac; done -while read line -do +while read line; do #comment - if [[ $line == \#* ]] - then - continue - fi + if [[ $line == \#* ]]; then + continue - if [ "$line" == "" ] - then + elif [ "$line" == "" ]; then read line version=$line log_it "VR config: configuation format version $version" #skip read line - continue - fi - if [ "$line" == " read line log_it "VR config: execution success " - continue - fi - if [ "$line" == "" ] - then + elif [ "$line" == "" ]; then read line file=$line log_it "VR config: creating file: $file" rm -f $file - while read -r line - do - if [ "$line" == "" ] - then + while read -r line; do + if [ "$line" == "" ]; then break fi echo $line >> $file done log_it "VR config: create file success" - continue + fi + done < $cfg # archive the configuration file