Browse Source

fixed parsing mismatch, improved saving and really enabled saving ...

git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@1955 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
rocklinux
Rene Rebe 21 years ago
parent
commit
cfa2df7d09
1 changed files with 20 additions and 10 deletions
  1. +20
    -10
      package/base/iproute2/stone_mod_network.sh

+ 20
- 10
package/base/iproute2/stone_mod_network.sh

@ -34,8 +34,8 @@ read_section() {
local readit=0 local readit=0
local i=0 local i=0
tags=""
interfaces=""
unset tags
unset interfaces
[ "$1" = "" ] && readit=1 [ "$1" = "" ] && readit=1
@ -81,18 +81,28 @@ write_section() {
# when we reached the matching section dump the # when we reached the matching section dump the
# mew tags ... # mew tags ...
if [ $passit = 0 -a $dumped = 0 ] ; then if [ $passit = 0 -a $dumped = 0 ] ; then
for (( i=0 ; $i < ${#tags[@]} ; i=i+1 )) ; do
echo "${tags[$i]}" # >> \
# $rocknet_base/config.new
done
dumped=1
for (( i=0 ; $i < ${#tags[@]} ; i=i+1 )) ; do
[ $globals = 1 -o \
"$netcmd" = "interface" ] || \
echo -en "\t" >> \
$rocknet_base/config.new
echo "${tags[$i]}" >> \
$rocknet_base/config.new
done
dumped=1
fi fi
[ $passit = 1 ] && echo "$netcmd $para" # >> \
#$rocknet_base/config.new
if [ $passit = 1 ] ; then
[ $globals = 1 -o \
"$netcmd" = "interface" ] || \
echo -en "\t" >> \
$rocknet_base/config.new
echo "$netcmd $para" >> \
$rocknet_base/config.new
fi
fi fi
done < <( sed 's,#.*,,' < "$rocknet_base"/config ) done < <( sed 's,#.*,,' < "$rocknet_base"/config )
# mv $rocknet_base/config{.new,}
mv $rocknet_base/config{.new,}
} }
edit_tag() { edit_tag() {

Loading…
Cancel
Save