2000-01-26 22:06:13 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2000-03-25 20:24:32 +00:00
|
|
|
[ "_$VMNET_HOST_IP" = _ ] && VMNET_HOST_IP="192.168.254.1"
|
|
|
|
[ "_$VMNET_NETMASK" = _ ] && VMNET_NETMASK="255.255.255.0"
|
|
|
|
|
|
|
|
host_ip=$VMNET_HOST_IP
|
|
|
|
netmask=$VMNET_NETMASK
|
|
|
|
title="VMware network options"
|
|
|
|
|
|
|
|
get_network_settings() {
|
|
|
|
result=`/usr/bin/dialog --title "$title" --clear --inputbox \
|
|
|
|
"\n"\
|
2000-04-01 23:20:59 +00:00
|
|
|
"What will be the IP address of your host\n"\
|
|
|
|
"on your private network?:"\
|
|
|
|
10 50 $host_ip \
|
2000-03-25 20:24:32 +00:00
|
|
|
2>&1 >/dev/tty `
|
|
|
|
|
|
|
|
case $? in
|
|
|
|
0)
|
|
|
|
if [ -z "$result" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
host_ip=$result
|
|
|
|
;;
|
|
|
|
1)
|
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
result=`/usr/bin/dialog --title "$title" --clear --inputbox \
|
|
|
|
"\n"\
|
2000-04-01 23:20:59 +00:00
|
|
|
"What will be the netmask of your private\n"\
|
|
|
|
"network?:"\
|
|
|
|
10 50 $netmask \
|
2000-03-25 20:24:32 +00:00
|
|
|
2>&1 >/dev/tty `
|
|
|
|
|
|
|
|
case $? in
|
|
|
|
0)
|
|
|
|
if [ -z "$result" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
netmask=$result
|
|
|
|
;;
|
|
|
|
1)
|
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
do_network() {
|
|
|
|
while true; do
|
|
|
|
get_network_settings
|
|
|
|
|
|
|
|
/usr/bin/dialog --title "Confirmation" --clear --yesno \
|
|
|
|
"\n"\
|
|
|
|
"Are the following options correct?\n\n"\
|
|
|
|
"IP address: $host_ip\n"\
|
|
|
|
"Netmask: $netmask\n"\
|
2000-04-01 23:20:59 +00:00
|
|
|
10 50
|
2000-03-25 20:24:32 +00:00
|
|
|
[ $? -eq 0 ] && return 0
|
|
|
|
|
|
|
|
/usr/bin/dialog --title "Confirmation" --clear --yesno \
|
|
|
|
"\n"\
|
|
|
|
"Do you want to edit network options again?\n"\
|
2000-04-01 23:20:59 +00:00
|
|
|
10 50
|
2000-03-25 20:24:32 +00:00
|
|
|
[ $? -eq 0 ] && continue
|
|
|
|
|
|
|
|
/usr/bin/dialog --title "Confirmation" --clear --yesno \
|
|
|
|
"\n"\
|
|
|
|
"Do you want to continue without networking?\n"\
|
|
|
|
10 50
|
|
|
|
[ $? -eq 0 ] && return 1
|
|
|
|
|
|
|
|
host_ip=$VMNET_HOST_IP
|
|
|
|
netmask=$VMNET_NETMASK
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
networking=0
|
|
|
|
if [ _$BATCH = _ ]; then
|
|
|
|
do_network
|
|
|
|
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
networking=1
|
|
|
|
/usr/bin/dialog --title "$title" --infobox \
|
|
|
|
"\n"\
|
|
|
|
"The following options will be used.\n\n"\
|
|
|
|
"IP address: $host_ip\n"\
|
|
|
|
"Netmask: $netmask\n"\
|
2000-04-01 23:20:59 +00:00
|
|
|
10 50
|
2000-03-25 20:24:32 +00:00
|
|
|
fi
|
|
|
|
else #BATCH
|
|
|
|
[ -f ${WRKDIR}/Makefile.inc.net ] && exit
|
|
|
|
fi #BATCH
|
|
|
|
|
|
|
|
(
|
|
|
|
exec > ${WRKDIR}/Makefile.inc.net
|
|
|
|
|
|
|
|
echo '#' `date`
|
|
|
|
echo VMNET_HOST_IP=$host_ip
|
|
|
|
echo VMNET_NETMASK=$netmask
|
2000-09-10 15:03:00 +00:00
|
|
|
echo VMNET_NETWORKING=$networking
|
2000-03-25 20:24:32 +00:00
|
|
|
)
|