Have you made your bash script executable (just checking, but I think you have)
Does any of these process need to be run as root?
If yes you may need to run the script as root
Beginner as well here
try this (I assume you do not want to type the key everytime and do not care about
having it in plain text in your system
#! /bin/bash
mykey=12345 #enter your key
# mykey="12345ABCD" #enter your key here with double quote this is probably better syntax if you have digits and characters
iwconfig eth1 essid NETGEAR
iwconfig eth1 key $mykey
iwconfig eth1
dhclient eth1
exit 0
There are lots of tutorials out there
This one of my prefered because it is short but quite complete
http://linux-pdf.xs4all.nl/data/alge...20Tutorial.pdf