Please, next time copy/paste your computer output between CODE tags. It is the # button in the tool bar of the poste editor. And please incluse the prompt and the command with that copy/paste sweep. Then you do not have to explain things like “Begin /etc/…” and “End /etc…”
Then back to your complaint that this script is not working. When this script is executed it does hardly do anything. It gives some varables a value and then it is finished.
Butt you do not execute it at all. You say you do
ifup tap0
Thus you start the tool ifup. Did ou check what the tool does with
man ifup
I have the strong idea that you are confusing the scripts in /etc/sysconfig/network/scripts wit the configuration files named in /etc/sysconfig/network/ifcfg-.
Look at an example script like /etc/sysconfig/network/scripts/ifup-skel and one of the ifcfg- file in /etc/sysconfig/network. Your file looks very much like the latter one, But those are no scripts, but configuration files.
The most important thing is of course if a device like tap0 realy exists.
I appoligize, but in fact your question looks like me a classical case of: Desccribe the Goal, not the Step ( http://www.catb.org/~esr/faqs/smart-questions.html#goal ).
Please tell what you are tying to achieve. IMHO you are walking tthe wrong path to get to your goal. People here will try to help you to find a path to get where you want to, but they must know what your goal is.