Use while read <
in process_conf_file()
This commit is contained in:
parent
3b91eda6db
commit
a22a055fe3
1 changed files with 8 additions and 7 deletions
13
init.sh
13
init.sh
|
@ -131,7 +131,7 @@ http_response=$(wget --spider --server-response "$url" 2>&1 | grep HTTP/ | tail
|
|||
if [ "$http_response" -eq 200 ]
|
||||
then
|
||||
wget -c --progress=dot "$url" 2>&1 | grep --line-buffered "[0-9]\{1,3\}%" -o | awk '{printf ("\b\b\b\b%4s", $1)}'
|
||||
if [ "$?" -eq 0 ]
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
printf " \b\b\b\b\b done\n "
|
||||
else
|
||||
|
@ -145,12 +145,13 @@ fi
|
|||
}
|
||||
|
||||
process_conf_file (){
|
||||
for p in `cat $1 | grep '^[^#].*'`
|
||||
while read -r p
|
||||
do
|
||||
var=`echo "$p" | awk -F"=" '{print $1}'`
|
||||
param=`echo "$p" | awk -F"=" '{print $2}'`
|
||||
eval $var=$param
|
||||
done
|
||||
var=$(echo "$p" | awk -F"=" '{print $1}')
|
||||
param=$(echo "$p" | awk -F"=" '{print $2}')
|
||||
eval "$var"="$param"
|
||||
done < <( cat "$1" | grep '^[^#].*')
|
||||
|
||||
}
|
||||
|
||||
create_dir(){
|
||||
|
|
Reference in a new issue