so is your script something like
text file named netconnect.sh and made executable
and then with these contents in it
Minimally, yes, that is my script. However, my script is more complicated than that.
My primary box is multi-boot with Windows NT4 and Slackware. My second box is Slackware only. When I boot my primary box into Slackware, using fstab
I automatically mount all of my Windows partitions, all of which are NT4 partitions. I mount those partitions read-only, but, I also have one read-write FAT32 partition for sharing and shuffling files. I had that box configured for multi-booting a long time before I obtained my second box.
For consistency, I use the same mount points for either Slackware OS. For example, if I boot my primary box into Slackware, then my NT4 data files partition, which is my E:
partition when in Windows, is mounted at mount point /mnt/nt_e
. My shared FAT32 partition, which is my O:
partition in Windows, is mounted at /mnt/nt_o
. I have many Windows partitions, but those two examples should provide the idea. When I want to mount those Windows partitions from within my second box, I use the same mount point names. That kind of consistency keeps me from getting confused.
Because my primary box is multi-boot, my second box does not necessarily "know" which OS that box might be running. And I cannot predict that either. Therefore, my connection script needs to figure whether Windows or Slackware is the OS on the primary box. I use different box names for Windows and Slackware. In my script I ping the box name to test which OS I booted into. You might need to update your /etc/hosts
file to include the box names and IP addresses. I use static addresses.
I do not automatically run all of my networking services when in Windows because I don't tinker much these days with my two boxes. Most of the time I just boot into NT4 for surfing and email as well pounding away in Word 97. Therefore typically I have no need for localized networking most of the time. I'm stuck on dialup, so that too negates the need for continuous network services. When I find occasional spare time and want to play and learn then I manually start my Windows networking services with a script. Although I have 256MB in my primary box, which is more than enough for NT4 even if I were to run networking services continuously, I've been around personal computers for almost 25 years. Thus, I'm sort of a throwback to the days and philosophy when one did not run unnecessary services and programs. Old habits like that are challenging to break.
When I want to tinker and I forget to start my Windows networking services, my second box netconnect
script provides me error messages on screen. I do the Homer Simpson "Doh!", quickly run my Windows script, run my netconnect
script again, and then everything connects fine.
Automating all of this is always an ultimate goal, but because I already know that most of the time I am not networking both boxes, I prefer to simply run my scripts manually. That would change if I finally had access to a broadband connection for the web. Then I'd have to start some of the Windows network services all the time.
I haven't finished the netconnect
script for when I boot my primary box into Slackware because I have not found the time to update that box to 10.2. I probably will not do that until this coming winter and then I'll update both boxes to Slackware 10.3/11.0. I want to update both boxes with the same version of KDE too. When I finally update my boxes I want my Slackware user scripts and rc.d scripts on both boxes to work the same and eventually I'll write some sort of automatic synchronizing script to perform that for me.
But for now my manual methods are okay because when I want to connect my second box to my primary box, the primary box usually is in Windows. When I am running Slackware on both boxes I connect using the Konqueror fish (ssh) protocol. That is sufficient for me when I want to sync or browse files and the like.
With that said and done, I am providing a link to a copy of the script at my web site. Feel free to modify as you see fit. Understand that this script is not finished and is a work in progress.
The script sources a colorization script: /etc/functions-colors
What I have done probably overkill is for many people, but in a tinkering environment the script provides a lot of flexibility.