creating VLAN setup script - help needed
hello
i am trying to create a script that will setup 3 VLANs i have tried to create a script (below) it fails miserably. if somebody could provide me with suggestion on how to correct it .. thanks, Code:
#! /bin/bash |
It would help a lot if you could be a bit more specific as to what isn't working, and what error messages you're getting, if any.
I can see at least two problems with your script:
|
thanks
since i running this script on installation that i control. i did not think about testing for the module. but i do not understand what you meant by 'running ip by spawning instances of sh (why?) that won't return control to your script' - what would be your suggestion to do this properly?? |
Quote:
Code:
sh $(ip addr add 192.168.21.19/24 dev $ADAPTER.21) Instead, you could simply do this: Code:
ip addr add 192.168.21.19/24 dev $ADAPTER.21 |
thanks a lot for that!!
i was getting these 'hangs' without understanding why; and now i know another problem that i find if the check to see the interface already exists. i try Code:
if [ ! -z "$( ifconfig $ADAPTER.21 | grep -i "link" )" ] ; any suggestion on that? thanks, |
Quote:
Code:
if [ ! -z "$( ifconfig $ADAPTER.21 2>/dev/null | grep -i "link" )" ] ; |
thanks Ser Olmy for helping me out with this script
and for also teaching me a couple of things along the way. with regards, |
All times are GMT -5. The time now is 04:19 AM. |