Changeset 9789 in vbox for trunk/src/VBox/Installer/linux
- Timestamp:
- Jun 18, 2008 2:42:23 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 32157
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/vboxnet.sh.in
r9108 r9789 180 180 if ((! expr match "$2" "#" > /dev/null) && 181 181 (test -z "$4" || expr match "$4" "#" > /dev/null)); then 182 # Name our parameters, to make this script slightly less unreadable 183 interface=$1 184 user=$2 185 bridge=$3 182 186 # As the very first thing, try delete the interface. Might already 183 187 # exist with different configuration. Ignore errors. 184 VBoxTunctl -d $ 1> /dev/null 2>&1188 VBoxTunctl -d $interface > /dev/null 2>&1 185 189 case $user in 186 190 +*) 187 group=`echo $ 2| cut -c2-`188 cmd="VBoxTunctl -t $ 1-g $group"191 group=`echo $user | cut -c2-` 192 cmd="VBoxTunctl -t $interface -g $group" 189 193 ;; 190 194 *) 191 cmd="VBoxTunctl -t $ 1 -u $2"195 cmd="VBoxTunctl -t $interface -u $user" 192 196 ;; 193 197 esac … … 198 202 i=1 199 203 while [ $i -le 10 ]; do 200 ifconfig "$ 1" up 2> /dev/null201 if ifconfig | grep "$ 1" > /dev/null; then204 ifconfig "$interface" up 2> /dev/null 205 if ifconfig | grep "$interface" > /dev/null; then 202 206 # Add the interface to a bridge if one was specified 203 if [ -n "$ 3" ]; then204 if brctl addif "$ 3" "$1" 2> /dev/null; then205 echo "$ 1 $2 $3" >> "$VARFILE"207 if [ -n "$bridge" ]; then 208 if brctl addif "$bridge" "$interface" 2> /dev/null; then 209 echo "$interface $user $bridge" >> "$VARFILE" 206 210 else 207 echo "$ 1 $2" >> "$VARFILE"208 echo "Warning - failed to add interface $ 1 to the bridge $3"211 echo "$interface $user" >> "$VARFILE" 212 echo "Warning - failed to add interface $interface to the bridge $bridge" 209 213 fi 210 214 else 211 echo "$ 1 $2" >> "$VARFILE"215 echo "$interface $user" >> "$VARFILE" 212 216 fi 213 217 i=20 … … 218 222 done 219 223 if [ $i -ne 20 ]; then 220 echo "Warning - failed to bring up the interface $ 1"224 echo "Warning - failed to bring up the interface $interface" 221 225 fi 222 226 else 223 echo "Warning - failed to create the interface $ 1 for the user $2"227 echo "Warning - failed to create the interface $interface for the user $user" 224 228 fi 225 229 else
Note:
See TracChangeset
for help on using the changeset viewer.