In the menu select
Setup -> "Internet Connection Wizard"
which loads the script:
/usr/sbin/connectwizard
If you then select the button which says
"Wired or Wireless Land"
a new wizard is loaded for wired & wireless LANs. This new wizard is defined in the file:
/usr/sbin/connectwizard_2nd
This wizard gives three choices of wizards for configuring wired or wireless LAN. They are:
"Simple Network Setup"
"Frisbee"
"Network WIzard"
it is the last option which loads:
/usr/sbin/net-setup.sh
The description for the wizard is
The strength of this wizard from my experience is that it is able to load network drives which cannot be loaded by the "Simple Network Connection Wizard".This is the most sophisticated tool for network setup in PUppy. It is based on the 'Classic' Network Wizard originaly written by BarryK, but greatly enhanced by Doubal, Rarsa, Shinobar and others. It is for both wired (Ethernet) and wireless connectivity, with more configuration features than Frisbee and SNS
The line numbers that I will quote in the following text assume the user is using tahrpup but the script should be similar in most recent versions of puppylinux (fatdog64 being a notable exception).
The first problem area to fix is the script sets an app directory based on where the function is called from. This may make it easy to move the script but it is problematic if we try to load the script into the current evaluation context using the source operator.
To remady this I changed lines 75 to 78 of net-setup.sh from
Code: Select all
APPDIR="$(dirname $0)"
[ "$APPDIR" = "." ] && APPDIR="$(pwd)"
Code: Select all
if ! [ -n "$APPDIR" ]; then
APPDIR="$(dirname $0)"
[ "$APPDIR" = "." ] && APPDIR="$(pwd)"
fi
I could add a second test that checks if the evaluation context is something other than net-setup.sh. We will see this trick below for a different application.
The next thing that you have to do is to ensure that the following functions
Code: Select all
setDefaultMODULEBUTTONS
refreshMainWindowInfo
showMainWindow
The evaluation context can be obtained by the code
Code: Select all
CURRENT_CONTEXT=$(expr "$0" : '.*/\(.*\)$' )
To accomplish this lines 1809 to 1842 of my net-setup.sh look as follows
Code: Select all
#=============================================================================
#=============== START OF SCRIPT BODY ====================
#=============================================================================
# Cleanup older temp files (in case didn't exit nicely last time)
cleanUpTmp
# Do we have pcmcia hardware?...
if elspci -l | grep -E -q '60700|60500' ; then
MPCMCIA="yes"
fi
BGCOLOR="#ffe0e0" #light red.
TOPMSG="$L_TOPMSG_Initial"
CURRENT_CONTEXT=$(expr "$0" : '.*/\(.*\)$' )
if [ "${CURRENT_CONTEXT}" = "net-setup.sh" ] ; then
setDefaultMODULEBUTTONS
refreshMainWindowInfo
showMainWindow
# Dougal: clean up /tmp
cleanUpTmp
#v411 BK hack to remove old network wizard configs so rc.sysinit won't use them if old wizard installed...
[ "`ls -1 /etc/network-wizard/network/interfaces 2>/dev/null`" != "" ] && rm -f /etc/*[0-9]mode
fi
#=============================================================================
#================ END OF SCRIPT BODY =====================
#=============================================================================
Code: Select all
root# getInterfaceList
root# echo "$INTERFACES"
eth0 ra0
So based on this let's try
Code: Select all
root# findInterfaceInfo "ra0"
root# echo "$INTTYPE $FI_DRIVER $TYPE $INFO"
Wireless usb usb Ralink 11n Adapter
As a final note the function configureWirless of net-setup.sh assigns it's first argument to a variable called interface. Let's assume it is looking for something along the lines of "ra0". In the second line of the function configureWirless there is the following statement
Code: Select all
showProfilesWindow "$INTERFACE"
/usr/sbin/wag-profiles.sh
wag-profiles.sh when called as a sub-shell loads a wizard for connecting your wireless interface to a network device via wirelss Ethernet. However, it does not assign an ip adress. The ip adress is assigned in the wizard which called net-setup.sh (or equivlanetly the showProfilesWindow() function)
Alternatively, If wag-profiles.sh is called via the source operatoer then it acts as a function library.
My next goal is to use the functions in both:
net-setup.sh and wag-profiles.sh to configure my network without using the network wizards. I will probably explain this in a separate thread.
In this thread I will explore more of the functions in net-setup.sh via the command line.
***As a final disclaimer, net-setup.sh is called from many files within puppylinux. We can see which files by using a grep command. I cannot promise that my modifications won't break anything. I will let people know whether I have any issues with my mods.